diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 23:02:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 23:02:30 +0300 |
commit | 41fe97390ceddf945f3d967b8fdb3de4c66b7dea (patch) | |
tree | 9c8d89a8624828992f06d892cd2f43818ff5dcc8 /spec/services/todo_service_spec.rb | |
parent | 0804d2dc31052fb45a1efecedc8e06ce9bc32862 (diff) |
Add latest changes from gitlab-org/gitlab@14-9-stable-eev14.9.0-rc42
Diffstat (limited to 'spec/services/todo_service_spec.rb')
-rw-r--r-- | spec/services/todo_service_spec.rb | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/spec/services/todo_service_spec.rb b/spec/services/todo_service_spec.rb index 7103cb0b66a..6e10d0281b7 100644 --- a/spec/services/todo_service_spec.rb +++ b/spec/services/todo_service_spec.rb @@ -628,12 +628,32 @@ RSpec.describe TodoService do stub_feature_flags(multiple_todos: true) end - it 'creates a todo even if user already has a pending todo' do + it 'creates a MENTIONED todo even if user already has a pending MENTIONED todo' do create(:todo, :mentioned, user: member, project: project, target: issue, author: author) expect { service.update_issue(issue, author) }.to change(member.todos, :count) end + it 'creates a DIRECTLY_ADDRESSED todo even if user already has a pending DIRECTLY_ADDRESSED todo' do + create(:todo, :directly_addressed, user: member, project: project, target: issue, author: author) + + issue.update!(description: "#{member.to_reference}, what do you think?") + + expect { service.update_issue(issue, author) }.to change(member.todos, :count) + end + + it 'creates an ASSIGNED todo even if user already has a pending MARKED todo' do + create(:todo, :marked, user: john_doe, project: project, target: assigned_issue, author: author) + + expect { service.reassigned_assignable(assigned_issue, author) }.to change(john_doe.todos, :count) + end + + it 'does not create an ASSIGNED todo if user already has an ASSIGNED todo' do + create(:todo, :assigned, user: john_doe, project: project, target: assigned_issue, author: author) + + expect { service.reassigned_assignable(assigned_issue, author) }.not_to change(john_doe.todos, :count) + end + it 'creates multiple todos if a user is assigned and mentioned in a new issue' do assigned_issue.description = mentions service.new_issue(assigned_issue, author) |