diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-01-04 21:40:07 +0300 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-01-05 00:17:03 +0300 |
commit | 8cc14dd5371c33f389211fcee39dbb28686b2021 (patch) | |
tree | 5d112a8a9cc325dd7c781db3a68e5c7cac6889d1 /spec | |
parent | 7d7d289b159fba332c68dc66b6f9f3b17428c3a3 (diff) |
Rename Project#cache_index to jobs_cache_index
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/ci/build_spec.rb | 8 | ||||
-rw-r--r-- | spec/services/reset_project_cache_service_spec.rb | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 96513281994..8cecaf16fdf 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -265,17 +265,17 @@ describe Ci::Build do allow(build).to receive(:options).and_return(options) end - context 'when project has cache_index' do + context 'when project has jobs_cache_index' do before do - allow_any_instance_of(Project).to receive(:cache_index).and_return(1) + allow_any_instance_of(Project).to receive(:jobs_cache_index).and_return(1) end it { is_expected.to include(key: "key:1") } end - context 'when project does not have cache_index' do + context 'when project does not have jobs_cache_index' do before do - allow_any_instance_of(Project).to receive(:cache_index).and_return(nil) + allow_any_instance_of(Project).to receive(:jobs_cache_index).and_return(nil) end it { is_expected.to eq([options[:cache]]) } diff --git a/spec/services/reset_project_cache_service_spec.rb b/spec/services/reset_project_cache_service_spec.rb index df969d08f39..de475d16586 100644 --- a/spec/services/reset_project_cache_service_spec.rb +++ b/spec/services/reset_project_cache_service_spec.rb @@ -8,21 +8,21 @@ describe ResetProjectCacheService do context 'when project cache_index is nil' do before do - project.cache_index = nil + project.jobs_cache_index = nil end it 'sets project cache_index to one' do - expect { subject }.to change { project.reload.cache_index }.from(nil).to(1) + expect { subject }.to change { project.reload.jobs_cache_index }.from(nil).to(1) end end context 'when project cache_index is a numeric value' do before do - project.update_attributes(cache_index: 1) + project.update_attributes(jobs_cache_index: 1) end it 'increments project cache index' do - expect { subject }.to change { project.reload.cache_index }.by(1) + expect { subject }.to change { project.reload.jobs_cache_index }.by(1) end end end |