summaryrefslogtreecommitdiff
path: root/spec/models/ci/commit_spec.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-09-28 13:35:26 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2015-09-29 10:47:03 +0200
commit0e3381470870732dff69c9298131062f786d55e7 (patch)
tree02a4a5e588c73c066fa80222b03065d3b8295e24 /spec/models/ci/commit_spec.rb
parent30c78e70cba395c1336611c58891a75473f8a037 (diff)
downloadgitlab-ce-0e3381470870732dff69c9298131062f786d55e7.tar.gz
Fix tests
Diffstat (limited to 'spec/models/ci/commit_spec.rb')
-rw-r--r--spec/models/ci/commit_spec.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/models/ci/commit_spec.rb b/spec/models/ci/commit_spec.rb
index c277cbd8bc0..5429151c8d9 100644
--- a/spec/models/ci/commit_spec.rb
+++ b/spec/models/ci/commit_spec.rb
@@ -18,11 +18,13 @@
require 'spec_helper'
describe Ci::Commit do
- let(:commit) { FactoryGirl.create :ci_commit }
- let(:commit_with_project) { FactoryGirl.create :ci_commit }
+ let(:project) { FactoryGirl.create :ci_project }
+ let(:gl_project) { FactoryGirl.create :empty_project, gitlab_ci_project: project }
+ let(:commit) { FactoryGirl.create :ci_commit, gl_project: gl_project }
+ let(:commit_with_project) { FactoryGirl.create :ci_commit, gl_project: gl_project }
let(:config_processor) { Ci::GitlabCiYamlProcessor.new(gitlab_ci_yaml) }
- it { is_expected.to belong_to(:project) }
+ it { is_expected.to belong_to(:gl_project) }
it { is_expected.to have_many(:builds) }
it { is_expected.to validate_presence_of :before_sha }
it { is_expected.to validate_presence_of :sha }
@@ -87,7 +89,7 @@ describe Ci::Commit do
email_add_pusher: false,
email_recipients: 'rec1 rec2'
gl_project = FactoryGirl.create :empty_project, gitlab_ci_project: project
- commit = FactoryGirl.create :ci_commit, project: gl_project
+ commit = FactoryGirl.create :ci_commit, gl_project: gl_project
expect(commit.project_recipients).to eq(['rec1', 'rec2'])
end
@@ -96,7 +98,7 @@ describe Ci::Commit do
email_add_pusher: true,
email_recipients: 'rec1 rec1 rec2'
gl_project = FactoryGirl.create :empty_project, gitlab_ci_project: project
- commit = FactoryGirl.create :ci_commit, project: gl_project
+ commit = FactoryGirl.create :ci_commit, gl_project: gl_project
expected = 'rec2'
allow(commit).to receive(:push_data) { { user_email: expected } }
expect(commit.project_recipients).to eq(['rec1', 'rec2'])