2019-10-15 05:06:09 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-04-09 08:41:55 -04:00
|
|
|
require 'rake_helper'
|
|
|
|
|
2020-06-24 11:08:50 -04:00
|
|
|
RSpec.describe 'clearing redis cache' do
|
2018-04-09 08:41:55 -04:00
|
|
|
before do
|
|
|
|
Rake.application.rake_require 'tasks/cache'
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'clearing pipeline status cache' do
|
2018-11-23 03:41:08 -05:00
|
|
|
let(:pipeline_status) do
|
|
|
|
project = create(:project, :repository)
|
|
|
|
create(:ci_pipeline, project: project).project.pipeline_status
|
|
|
|
end
|
2018-04-09 08:41:55 -04:00
|
|
|
|
|
|
|
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
|