summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-10-26 20:06:34 +0200
committerMatija Čupić <matteeyah@gmail.com>2018-10-26 20:06:34 +0200
commit77cfdb0aead31e3f3ceb7208b8bd39a88bc13f9e (patch)
treee6a8489315322db9036c7ac2202d62ff3177de4d
parent0079fa19ce493da761a07f3dca2a3caf0a2476d7 (diff)
downloadgitlab-ce-52780-stale-pipeline-status-cache-for-_project-after-disabling-pipelines.tar.gz
-rw-r--r--spec/lib/gitlab/cache/ci/project_pipeline_status_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/lib/gitlab/cache/ci/project_pipeline_status_spec.rb b/spec/lib/gitlab/cache/ci/project_pipeline_status_spec.rb
index 4d5081b0a75..e5999a1c509 100644
--- a/spec/lib/gitlab/cache/ci/project_pipeline_status_spec.rb
+++ b/spec/lib/gitlab/cache/ci/project_pipeline_status_spec.rb
@@ -282,6 +282,21 @@ describe Gitlab::Cache::Ci::ProjectPipelineStatus, :clean_gitlab_redis_cache do
expect(pipeline_status.status).to eq(status)
expect(pipeline_status.ref).to eq(ref)
end
+
+ context 'when status is empty string' do
+ before do
+ Gitlab::Redis::Cache.with do |redis|
+ redis.mapped_hmset(cache_key,
+ { sha: sha, status: '', ref: ref })
+ end
+ end
+
+ it 'reads the status as nil' do
+ pipeline_status.load_from_cache
+
+ expect(pipeline_status.status).to eq(nil)
+ end
+ end
end
describe '#has_cache?' do