diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-02-06 19:06:00 +0100 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-02-06 19:06:00 +0100 |
commit | e27ea805457a3b794d7a8b3b6b0355eddb1c1eca (patch) | |
tree | 813a23dab42e19487d54a6218fce411af5e6187d | |
parent | b75fa80eaae13b4474bac5453420988e14903c4f (diff) | |
download | gitlab-ce-e27ea805457a3b794d7a8b3b6b0355eddb1c1eca.tar.gz |
Fix RedisCacheable#cache_attributes spec38265-stuckcijobsworker-wrongly-detects-cancels-stuck-builds-when-per-job-timeout-is-more-than-an-hour
-rw-r--r-- | spec/models/concerns/redis_cacheable_spec.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/spec/models/concerns/redis_cacheable_spec.rb b/spec/models/concerns/redis_cacheable_spec.rb index ffb35079149..3d7963120b6 100644 --- a/spec/models/concerns/redis_cacheable_spec.rb +++ b/spec/models/concerns/redis_cacheable_spec.rb @@ -5,6 +5,7 @@ describe RedisCacheable do before do model.extend(described_class) + allow(model).to receive(:cache_attribute_key).and_return('key') end describe '#cached_attribute' do @@ -13,8 +14,6 @@ describe RedisCacheable do subject { model.cached_attribute(payload.keys.first) } it 'gets the cache attribute' do - expect(model).to receive(:cache_attribute_key).and_return('key') - Gitlab::Redis::SharedState.with do |redis| expect(redis).to receive(:get).with('key') .and_return(payload.to_json) @@ -31,10 +30,7 @@ describe RedisCacheable do it 'sets the cache attributes' do Gitlab::Redis::SharedState.with do |redis| - values.each do |key, value| - redis_key = model.send(:cache_attribute_key) - expect(redis).to receive(:set).with(redis_key, values.to_json, anything) - end + expect(redis).to receive(:set).with('key', values.to_json, anything) end subject |