diff options
Diffstat (limited to 'spec/workers/new_issue_worker_spec.rb')
-rw-r--r-- | spec/workers/new_issue_worker_spec.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/workers/new_issue_worker_spec.rb b/spec/workers/new_issue_worker_spec.rb index ec129ad3380..35b83c3bee8 100644 --- a/spec/workers/new_issue_worker_spec.rb +++ b/spec/workers/new_issue_worker_spec.rb @@ -3,6 +3,8 @@ require 'spec_helper' RSpec.describe NewIssueWorker do + include AfterNextHelpers + describe '#perform' do let(:worker) { described_class.new } @@ -49,7 +51,7 @@ RSpec.describe NewIssueWorker do expect(Notify).not_to receive(:new_issue_email) .with(mentioned.id, issue.id, NotificationReason::MENTIONED) - expect(Gitlab::AppLogger).to receive(:warn).with(message: 'Skipping sending notifications', user: user.id, klass: issue.class, object_id: issue.id) + expect(Gitlab::AppLogger).to receive(:warn).with(message: 'Skipping sending notifications', user: user.id, klass: issue.class.to_s, object_id: issue.id) worker.perform(issue.id, user.id) end @@ -80,6 +82,13 @@ RSpec.describe NewIssueWorker do worker.perform(issue.id, user.id) end + + it 'calls Issues::AfterCreateService' do + expect_next(::Issues::AfterCreateService) + .to receive(:execute) + + worker.perform(issue.id, user.id) + end end end end |