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