diff options
author | Valery Sizov <vsv2711@gmail.com> | 2015-03-04 20:48:56 +0200 |
---|---|---|
committer | Valery Sizov <vsv2711@gmail.com> | 2015-03-10 15:54:59 +0200 |
commit | 2fbe5a92eb777f038da775608d80b002833f88be (patch) | |
tree | 23522e7836be707c5e54434d949951d75905dea0 /spec/models/commit_spec.rb | |
parent | c95dfd87376bfe3913def89a34b47ad629e96073 (diff) | |
download | gitlab-ci-2fbe5a92eb777f038da775608d80b002833f88be.tar.gz |
Notify only pusher instead of commiter
Diffstat (limited to 'spec/models/commit_spec.rb')
-rw-r--r-- | spec/models/commit_spec.rb | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb index 891cd52..d93488c 100644 --- a/spec/models/commit_spec.rb +++ b/spec/models/commit_spec.rb @@ -79,23 +79,23 @@ describe Commit do describe :project_recipients do context 'always sending notification' do - it 'should return git_author_email as only recipient when no additional recipients are given' do + it 'should return commit_pusher_email as only recipient when no additional recipients are given' do project = FactoryGirl.create :project, email_add_committer: true, email_recipients: '' commit = FactoryGirl.create :commit, project: project - expected = 'git_author_email' - commit.stub(:git_author_email) { expected } + expected = 'commit_pusher_email' + commit.stub(:push_data) { { user_email: expected } } commit.project_recipients.should == [expected] end - it 'should return git_author_email and additional recipients' do + it 'should return commit_pusher_email and additional recipients' do project = FactoryGirl.create :project, email_add_committer: true, email_recipients: 'rec1 rec2' commit = FactoryGirl.create :commit, project: project - expected = 'git_author_email' - commit.stub(:git_author_email) { expected } + expected = 'commit_pusher_email' + commit.stub(:push_data) { { user_email: expected } } commit.project_recipients.should == ['rec1', 'rec2', expected] end @@ -104,8 +104,6 @@ describe Commit do email_add_committer: false, email_recipients: 'rec1 rec2' commit = FactoryGirl.create :commit, project: project - expected = 'git_author_email' - commit.stub(:git_author_email) { expected } commit.project_recipients.should == ['rec1', 'rec2'] end @@ -115,7 +113,7 @@ describe Commit do email_recipients: 'rec1 rec1 rec2' commit = FactoryGirl.create :commit, project: project expected = 'rec2' - commit.stub(:git_author_email) { expected } + commit.stub(:push_data) { { user_email: expected } } commit.project_recipients.should == ['rec1', 'rec2'] end end |