diff options
author | Nick Thomas <nick@gitlab.com> | 2017-12-11 16:45:07 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2017-12-11 16:45:07 +0000 |
commit | bd8b6518855bd9768ca5d245467b5ff0934e40b6 (patch) | |
tree | 5a6ffa8da66ea207a85a6bf3c6f560a745f7ffbf | |
parent | d9f40fddb704a60a38a95dd6433ff40ce65d738d (diff) | |
parent | bcbe5672ecaa3174cd0c2624a8cf6d0568e83654 (diff) | |
download | gitlab-ce-bd8b6518855bd9768ca5d245467b5ff0934e40b6.tar.gz |
Merge branch 'bw-fix-key-count-service-spec' into 'master'ch-test-me
small change to make less conflict with EE version
See merge request gitlab-org/gitlab-ce!15809
-rw-r--r-- | spec/services/users/keys_count_service_spec.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/spec/services/users/keys_count_service_spec.rb b/spec/services/users/keys_count_service_spec.rb index a188cf86772..bee8380e8b7 100644 --- a/spec/services/users/keys_count_service_spec.rb +++ b/spec/services/users/keys_count_service_spec.rb @@ -15,14 +15,12 @@ describe Users::KeysCountService, :use_clean_rails_memory_store_caching do expect(service.count).to eq(1) end - it 'caches the number of keys in Redis' do + it 'caches the number of keys in Redis', :request_store do + service.delete_cache + control_count = ActiveRecord::QueryRecorder.new { service.count }.count service.delete_cache - recorder = ActiveRecord::QueryRecorder.new do - 2.times { service.count } - end - - expect(recorder.count).to eq(1) + expect { 2.times { service.count } }.not_to exceed_query_limit(control_count) end end |