diff options
author | Rémy Coutable <remy@rymai.me> | 2016-09-09 09:57:31 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-09-09 09:57:31 +0000 |
commit | 12cc675ceb2c52b3f39260b807e48be91edb598c (patch) | |
tree | 7ad47dd5db0e64a9714a273edcede8ac33d359e5 /spec/controllers | |
parent | cf76776d03885c02b58df07dbca42bc455f4a841 (diff) | |
parent | 28e6bb39de56376fc4672ffc41927d63ad2f2440 (diff) | |
download | gitlab-ce-12cc675ceb2c52b3f39260b807e48be91edb598c.tar.gz |
Merge branch '21714-refresh-the-todos-count-cache-after-issuable-delete' into 'master'
Refresh todos count cache when an Issue/MR is deleted
Fixes #21714
See merge request !6161
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/projects/issues_controller_spec.rb | 6 | ||||
-rw-r--r-- | spec/controllers/projects/merge_requests_controller_spec.rb | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/spec/controllers/projects/issues_controller_spec.rb b/spec/controllers/projects/issues_controller_spec.rb index 16929767ddf..90419368f22 100644 --- a/spec/controllers/projects/issues_controller_spec.rb +++ b/spec/controllers/projects/issues_controller_spec.rb @@ -370,6 +370,12 @@ describe Projects::IssuesController do expect(response).to have_http_status(302) expect(controller).to set_flash[:notice].to(/The issue was successfully deleted\./).now end + + it 'delegates the update of the todos count cache to TodoService' do + expect_any_instance_of(TodoService).to receive(:destroy_issue).with(issue, owner).once + + delete :destroy, namespace_id: project.namespace.path, project_id: project.path, id: issue.iid + end end end diff --git a/spec/controllers/projects/merge_requests_controller_spec.rb b/spec/controllers/projects/merge_requests_controller_spec.rb index a219400d75f..94c9edc91fe 100644 --- a/spec/controllers/projects/merge_requests_controller_spec.rb +++ b/spec/controllers/projects/merge_requests_controller_spec.rb @@ -320,6 +320,12 @@ describe Projects::MergeRequestsController do expect(response).to have_http_status(302) expect(controller).to set_flash[:notice].to(/The merge request was successfully deleted\./).now end + + it 'delegates the update of the todos count cache to TodoService' do + expect_any_instance_of(TodoService).to receive(:destroy_merge_request).with(merge_request, owner).once + + delete :destroy, namespace_id: project.namespace.path, project_id: project.path, id: merge_request.iid + end end end |