diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /spec/models/ci/build_trace_chunks/fog_spec.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'spec/models/ci/build_trace_chunks/fog_spec.rb')
-rw-r--r-- | spec/models/ci/build_trace_chunks/fog_spec.rb | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/spec/models/ci/build_trace_chunks/fog_spec.rb b/spec/models/ci/build_trace_chunks/fog_spec.rb index 7ef3018d87b..a44ae58dfd2 100644 --- a/spec/models/ci/build_trace_chunks/fog_spec.rb +++ b/spec/models/ci/build_trace_chunks/fog_spec.rb @@ -40,7 +40,7 @@ RSpec.describe Ci::BuildTraceChunks::Fog do let(:model) { create(:ci_build_trace_chunk, :fog_without_data) } it 'returns nil' do - expect { data_store.data(model) }.to raise_error(Excon::Error::NotFound) + expect(data_store.data(model)).to be_nil end end end @@ -66,7 +66,7 @@ RSpec.describe Ci::BuildTraceChunks::Fog do let(:model) { create(:ci_build_trace_chunk, :fog_without_data) } it 'sets new data' do - expect { data_store.data(model) }.to raise_error(Excon::Error::NotFound) + expect(data_store.data(model)).to be_nil subject @@ -86,7 +86,7 @@ RSpec.describe Ci::BuildTraceChunks::Fog do subject - expect { data_store.data(model) }.to raise_error(Excon::Error::NotFound) + expect(data_store.data(model)).to be_nil end end @@ -94,11 +94,29 @@ RSpec.describe Ci::BuildTraceChunks::Fog do let(:model) { create(:ci_build_trace_chunk, :fog_without_data) } it 'does nothing' do - expect { data_store.data(model) }.to raise_error(Excon::Error::NotFound) + expect(data_store.data(model)).to be_nil subject - expect { data_store.data(model) }.to raise_error(Excon::Error::NotFound) + expect(data_store.data(model)).to be_nil + end + end + end + + describe '#size' do + context 'when data exists' do + let(:model) { create(:ci_build_trace_chunk, :fog_with_data, initial_data: 'üabcd') } + + it 'returns data bytesize correctly' do + expect(data_store.size(model)).to eq 6 + end + end + + context 'when data does not exist' do + let(:model) { create(:ci_build_trace_chunk, :fog_without_data) } + + it 'returns zero' do + expect(data_store.size(model)).to be_zero end end end |