Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/todo_service_spec.rb')
-rw-r--r--spec/services/todo_service_spec.rb15
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