diff options
Diffstat (limited to 'spec/services/issues/update_service_spec.rb')
-rw-r--r-- | spec/services/issues/update_service_spec.rb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/spec/services/issues/update_service_spec.rb b/spec/services/issues/update_service_spec.rb index 85b8fef685e..4739b7e0f28 100644 --- a/spec/services/issues/update_service_spec.rb +++ b/spec/services/issues/update_service_spec.rb @@ -29,6 +29,8 @@ RSpec.describe Issues::UpdateService, :mailer do end describe 'execute' do + let_it_be(:contact) { create(:contact, group: group) } + def find_note(starting_with) issue.notes.find do |note| note && note.note.start_with?(starting_with) @@ -57,7 +59,8 @@ RSpec.describe Issues::UpdateService, :mailer do due_date: Date.tomorrow, discussion_locked: true, severity: 'low', - milestone_id: milestone.id + milestone_id: milestone.id, + add_contacts: [contact.email] } end @@ -76,6 +79,7 @@ RSpec.describe Issues::UpdateService, :mailer do expect(issue.discussion_locked).to be_truthy expect(issue.confidential).to be_falsey expect(issue.milestone).to eq milestone + expect(issue.issue_customer_relations_contacts.last.contact).to eq contact end it 'updates issue milestone when passing `milestone` param' do @@ -319,7 +323,7 @@ RSpec.describe Issues::UpdateService, :mailer do opts[:move_between_ids] = [issue1.id, issue2.id] - expect(IssueRebalancingWorker).not_to receive(:perform_async) + expect(Issues::RebalancingWorker).not_to receive(:perform_async) update_issue(opts) expect(issue.relative_position).to be_between(issue1.relative_position, issue2.relative_position) @@ -335,7 +339,7 @@ RSpec.describe Issues::UpdateService, :mailer do opts[:move_between_ids] = [issue1.id, issue2.id] - expect(IssueRebalancingWorker).to receive(:perform_async).with(nil, nil, project.root_namespace.id) + expect(Issues::RebalancingWorker).to receive(:perform_async).with(nil, nil, project.root_namespace.id) update_issue(opts) expect(issue.relative_position).to be_between(issue1.relative_position, issue2.relative_position) @@ -349,7 +353,7 @@ RSpec.describe Issues::UpdateService, :mailer do opts[:move_between_ids] = [issue1.id, issue2.id] - expect(IssueRebalancingWorker).to receive(:perform_async).with(nil, nil, project.root_namespace.id) + expect(Issues::RebalancingWorker).to receive(:perform_async).with(nil, nil, project.root_namespace.id) update_issue(opts) expect(issue.relative_position).to be_between(issue1.relative_position, issue2.relative_position) @@ -363,7 +367,7 @@ RSpec.describe Issues::UpdateService, :mailer do opts[:move_between_ids] = [issue1.id, issue2.id] - expect(IssueRebalancingWorker).to receive(:perform_async).with(nil, nil, project.root_namespace.id) + expect(Issues::RebalancingWorker).to receive(:perform_async).with(nil, nil, project.root_namespace.id) update_issue(opts) expect(issue.relative_position).to be_between(issue1.relative_position, issue2.relative_position) |