diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2016-07-08 18:42:47 +0200 |
---|---|---|
committer | Paco Guzman <pacoguzmanp@gmail.com> | 2016-08-12 17:40:03 +0200 |
commit | 1f2253545ba7a902212bace29f144a2246eeedab (patch) | |
tree | e6575b0b351bf6f226f6eafa2b016cd31200943a /spec | |
parent | ec73abcd782ba9be95db62ecede09db7fe783aab (diff) | |
download | gitlab-ce-1f2253545ba7a902212bace29f144a2246eeedab.tar.gz |
Use cache for todos counter calling TodoService
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/todos_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/requests/api/todos_spec.rb b/spec/requests/api/todos_spec.rb index 3ccd0af652f..887a2ba5b84 100644 --- a/spec/requests/api/todos_spec.rb +++ b/spec/requests/api/todos_spec.rb @@ -117,6 +117,12 @@ describe API::Todos, api: true do expect(response.status).to eq(200) expect(pending_1.reload).to be_done end + + it 'updates todos cache' do + expect_any_instance_of(User).to receive(:update_todos_count_cache).and_call_original + + delete api("/todos/#{pending_1.id}", john_doe) + end end end @@ -139,6 +145,12 @@ describe API::Todos, api: true do expect(pending_2.reload).to be_done expect(pending_3.reload).to be_done end + + it 'updates todos cache' do + expect_any_instance_of(User).to receive(:update_todos_count_cache).and_call_original + + delete api("/todos", john_doe) + end end end |