fix pull request specs
This commit is contained in:
parent
0ee97af63d
commit
7f5a8c527b
|
@ -292,10 +292,9 @@ describe Projects::PullRequestsController, type: :controller do
|
||||||
ActionMailer::Base.deliveries = []
|
ActionMailer::Base.deliveries = []
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should send two email messages to project admins' do
|
it 'should send three email messages to project members' do
|
||||||
expect do
|
# project owner + project reader + project admin (project writer is a pull creator)
|
||||||
post :create, @create_params
|
expect { post :create, @create_params }.to change(ActionMailer::Base.deliveries, :count).by(3)
|
||||||
end.to change(ActionMailer::Base.deliveries, :count).by(2)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should send two email messages to admins and one to assignee' do
|
it 'should send two email messages to admins and one to assignee' do
|
||||||
|
@ -305,10 +304,9 @@ describe Projects::PullRequestsController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should not duplicate email message' do
|
it 'should not duplicate email message' do
|
||||||
expect do
|
expect {
|
||||||
post :create, @create_params.deep_merge(issue: {assignee_id: @project_admin.id})
|
post :create, @create_params.deep_merge(issue: {assignee_id: @project_admin.id})
|
||||||
end.to change(ActionMailer::Base.deliveries, :count).by(2) # send only to admins
|
}.to change(ActionMailer::Base.deliveries, :count).by(3) # send all project members
|
||||||
expect(ActionMailer::Base.deliveries.first.to).to_not eq ActionMailer::Base.deliveries.last.to
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue