diff options
| author | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-10-29 10:02:11 +0000 |
|---|---|---|
| committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-10-29 10:02:11 +0000 |
| commit | 5a460397a1ff9456e8bb85cf1938aed1e0c35722 (patch) | |
| tree | 373a9def76b9d3f5011dd0189f528068996acf94 /spec/lib | |
| parent | b868b02c626dc4f9986eb93e54cf593055121972 (diff) | |
| parent | 77cfdb0aead31e3f3ceb7208b8bd39a88bc13f9e (diff) | |
| download | gitlab-ce-5a460397a1ff9456e8bb85cf1938aed1e0c35722.tar.gz | |
Merge branch '52780-stale-pipeline-status-cache-for-_project-after-disabling-pipelines' into 'master'
Resolve "Stale pipeline status cache for `_project` after disabling pipelines"
Closes #52780
See merge request gitlab-org/gitlab-ce!22589
Diffstat (limited to 'spec/lib')
| -rw-r--r-- | spec/lib/gitlab/cache/ci/project_pipeline_status_spec.rb | 15 |
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 |
