From 0e3381470870732dff69c9298131062f786d55e7 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 28 Sep 2015 13:35:26 +0200 Subject: Fix tests --- spec/models/ci/commit_spec.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'spec/models/ci/commit_spec.rb') 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']) -- cgit v1.2.1