From 17417456b43ef4ed83eaa630758e4449268dcb6b Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Thu, 11 Jul 2013 17:19:18 +0600 Subject: [PATCH] [#200] add update assignee issue spec --- .../controllers/projects/pull_requests_controller_spec.rb | 6 ------ spec/models/issue_spec.rb | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/spec/controllers/projects/pull_requests_controller_spec.rb b/spec/controllers/projects/pull_requests_controller_spec.rb index 85ba6a1be..dd8e81d9c 100644 --- a/spec/controllers/projects/pull_requests_controller_spec.rb +++ b/spec/controllers/projects/pull_requests_controller_spec.rb @@ -310,12 +310,6 @@ describe Projects::PullRequestsController do ActionMailer::Base.deliveries.count.should == 3 end - it 'should send email message to new assignee' do - put :update, @update_params.deep_merge(:pull_request => {:assignee_id => @project_reader.id}) - @project.pull_requests.last.issue.send(:send_assign_notifications) - ActionMailer::Base.deliveries.count.should == 1 - end - it 'should not duplicate email message' do post :create, @create_params.deep_merge(:issue => {:assignee_id => @project_admin.id}) @project.pull_requests.last.issue.send(:new_issue_notifications) diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb index df89c3875..103a019c8 100644 --- a/spec/models/issue_spec.rb +++ b/spec/models/issue_spec.rb @@ -50,6 +50,14 @@ describe Issue do Comment.where(:automatic => true, :commentable_type => 'Issue', :created_from_issue_id => another_issue.id).count.should == 1 end + + it 'should send email message to new assignee' do + create_issue(@user) + ActionMailer::Base.deliveries = [] + @issue.update_attribute :assignee_id, @user.id + @issue.send(:send_assign_notifications, :update) + ActionMailer::Base.deliveries.count.should == 1 + end end context 'for member-group' do