[#200] add update assignee issue spec

This commit is contained in:
Alexander Machehin 2013-07-11 17:19:18 +06:00
parent 939f0dfe05
commit 17417456b4
2 changed files with 8 additions and 6 deletions

View File

@ -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)

View File

@ -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