2019-12-21 20:55:43 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-10-15 14:42:47 +05:30
|
|
|
require 'rake_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe 'clearing redis cache' do
|
2018-10-15 14:42:47 +05:30
|
|
|
before do
|
|
|
|
Rake.application.rake_require 'tasks/cache'
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'clearing pipeline status cache' do
|
2019-02-15 15:39:39 +05:30
|
|
|
let(:pipeline_status) do
|
|
|
|
project = create(:project, :repository)
|
|
|
|
create(:ci_pipeline, project: project).project.pipeline_status
|
|
|
|
end
|
2018-10-15 14:42:47 +05:30
|
|
|
|
|
|
|
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
|