Commit 80a2eb5d authored by Douwe Maan's avatar Douwe Maan

Fix spec

parent 8c308e3d
...@@ -3,13 +3,15 @@ require 'spec_helper' ...@@ -3,13 +3,15 @@ require 'spec_helper'
describe Issues::UpdateService do describe Issues::UpdateService do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:user2) { create(:user) } let(:user2) { create(:user) }
let(:issue) { create(:issue, title: 'Old title', assignee_id: user.id) } let(:user3) { create(:user) }
let(:issue) { create(:issue, title: 'Old title', assignee_id: user3.id) }
let(:label) { create(:label) } let(:label) { create(:label) }
let(:project) { issue.project } let(:project) { issue.project }
before do before do
project.team << [user, :master] project.team << [user, :master]
project.team << [user2, :developer] project.team << [user2, :developer]
project.team << [user3, :developer]
end end
describe 'execute' do describe 'execute' do
...@@ -37,8 +39,8 @@ describe Issues::UpdateService do ...@@ -37,8 +39,8 @@ describe Issues::UpdateService do
it 'should send email to user2 about assign of new issue and email to user about issue unassignment' do it 'should send email to user2 about assign of new issue and email to user about issue unassignment' do
deliveries = ActionMailer::Base.deliveries deliveries = ActionMailer::Base.deliveries
email = deliveries.last email = deliveries.last
recipients = deliveries.map(&:to).uniq.flatten recipients = deliveries.last(2).map(&:to).flatten
expect(recipients.last(2)).to include(user.email,user2.email) expect(recipients).to include(user2.email, user3.email)
expect(email.subject).to include(issue.title) expect(email.subject).to include(issue.title)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment