diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 15:44:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 15:44:42 +0000 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /spec/services/todo_service_spec.rb | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) | |
download | gitlab-ce-4555e1b21c365ed8303ffb7a3325d773c9b8bf31.tar.gz |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'spec/services/todo_service_spec.rb')
-rw-r--r-- | spec/services/todo_service_spec.rb | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/spec/services/todo_service_spec.rb b/spec/services/todo_service_spec.rb index 59f936509df..6a8e6dc8970 100644 --- a/spec/services/todo_service_spec.rb +++ b/spec/services/todo_service_spec.rb @@ -345,17 +345,10 @@ RSpec.describe TodoService do describe '#destroy_target' do it 'refreshes the todos count cache for users with todos on the target' do - create(:todo, state: :pending, target: issue, user: john_doe, author: john_doe, project: issue.project) + create(:todo, state: :pending, target: issue, user: author, author: author, project: issue.project) + create(:todo, state: :done, target: issue, user: assignee, author: assignee, project: issue.project) - expect_next(Users::UpdateTodoCountCacheService, [john_doe]).to receive(:execute) - - service.destroy_target(issue) { issue.destroy! } - end - - it 'does not refresh the todos count cache for users with only done todos on the target' do - create(:todo, :done, target: issue, user: john_doe, author: john_doe, project: issue.project) - - expect(Users::UpdateTodoCountCacheService).not_to receive(:new) + expect_next(Users::UpdateTodoCountCacheService, [author.id, assignee.id]).to receive(:execute) service.destroy_target(issue) { issue.destroy! } end @@ -1101,7 +1094,7 @@ RSpec.describe TodoService do it 'updates cached counts when a todo is created' do issue = create(:issue, project: project, assignees: [john_doe], author: author) - expect_next(Users::UpdateTodoCountCacheService, [john_doe]).to receive(:execute) + expect_next(Users::UpdateTodoCountCacheService, [john_doe.id]).to receive(:execute) service.new_issue(issue, author) end |