diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-16 15:12:38 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-16 15:12:38 +0300 |
commit | 93fb07b8c9edb0f3e860d7670b47e03a136d1a57 (patch) | |
tree | 3a0def9b247850b5510e11faafd628101bb9c06f /spec/workers/new_issue_worker_spec.rb | |
parent | d75ac09b4a880ba2d36d510a5720dd550b0809e9 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers/new_issue_worker_spec.rb')
-rw-r--r-- | spec/workers/new_issue_worker_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/workers/new_issue_worker_spec.rb b/spec/workers/new_issue_worker_spec.rb index 35b83c3bee8..b9053b10419 100644 --- a/spec/workers/new_issue_worker_spec.rb +++ b/spec/workers/new_issue_worker_spec.rb @@ -74,6 +74,8 @@ RSpec.describe NewIssueWorker do it 'creates a new event record' do expect { worker.perform(issue.id, user.id) }.to change { Event.count }.from(0).to(1) + + expect(Event.last).to have_attributes(target_id: issue.id, target_type: 'Issue') end it 'creates a notification for the mentioned user' do @@ -89,6 +91,14 @@ RSpec.describe NewIssueWorker do worker.perform(issue.id, user.id) end + + context 'when a class is set' do + it 'creates event with the correct type' do + expect { worker.perform(issue.id, user.id, 'WorkItem') }.to change { Event.count }.from(0).to(1) + + expect(Event.last).to have_attributes(target_id: issue.id, target_type: 'WorkItem') + end + end end end end |