summaryrefslogtreecommitdiff
path: root/spec/tasks
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-04-09 20:41:55 +0800
committerLin Jen-Shin <godfat@godfat.org>2018-04-10 20:57:00 +0800
commit4b30aec0aa9e52d3d7d4394f05a725d14e0c0db3 (patch)
tree7fc3713103151a70d08404fa0b48a49b25dfa026 /spec/tasks
parentde36ca81d35992c265cd4fd09c774cb793dbd246 (diff)
downloadgitlab-ce-4b30aec0aa9e52d3d7d4394f05a725d14e0c0db3.tar.gz
Allow `rake cache:clear` clearing pipeline status cache44582-clear-pipeline-status-cache
* Use the correct key prefix * Clear old cache keys TODO: At some point we could remove clearing old cache keys.
Diffstat (limited to 'spec/tasks')
-rw-r--r--spec/tasks/cache/clear/redis_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/tasks/cache/clear/redis_spec.rb b/spec/tasks/cache/clear/redis_spec.rb
new file mode 100644
index 00000000000..cca2b864e9b
--- /dev/null
+++ b/spec/tasks/cache/clear/redis_spec.rb
@@ -0,0 +1,19 @@
+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