gitlab-org--gitlab-foss/spec/tasks/cache/clear/redis_spec.rb
Lin Jen-Shin 4b30aec0aa Allow rake cache:clear clearing pipeline status cache
* Use the correct key prefix
* Clear old cache keys

TODO:

At some point we could remove clearing old cache keys.
2018-04-10 20:57:00 +08:00

19 lines
488 B
Ruby

require 'rake_helper'
describe 'clearing redis cache' do
before do
Rake.application.rake_require 'tasks/cache'
end
describe 'clearing pipeline status cache' do
let(:pipeline_status) { create(:ci_pipeline).project.pipeline_status }
before do
allow(pipeline_status).to receive(:loaded).and_return(nil)
end
it 'clears pipeline status cache' do
expect { run_rake_task('cache:clear:redis') }.to change { pipeline_status.has_cache? }
end
end
end