diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /spec/models/ci/build_trace_chunks/fog_spec.rb | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'spec/models/ci/build_trace_chunks/fog_spec.rb')
-rw-r--r-- | spec/models/ci/build_trace_chunks/fog_spec.rb | 42 |
1 files changed, 11 insertions, 31 deletions
diff --git a/spec/models/ci/build_trace_chunks/fog_spec.rb b/spec/models/ci/build_trace_chunks/fog_spec.rb index 21dab6fad60..bbf04ef9430 100644 --- a/spec/models/ci/build_trace_chunks/fog_spec.rb +++ b/spec/models/ci/build_trace_chunks/fog_spec.rb @@ -107,37 +107,22 @@ RSpec.describe Ci::BuildTraceChunks::Fog do let(:model) { create(:ci_build_trace_chunk, :fog_with_data, initial_data: initial_data) } let(:data) { data_store.data(model) } - context 'when ci_job_trace_force_encode is enabled' do - it 'appends ASCII data' do - data_store.append_data(model, +'hello world', 4) + it 'appends ASCII data' do + data_store.append_data(model, +'hello world', 4) - expect(data.encoding).to eq(Encoding::ASCII_8BIT) - expect(data.force_encoding(Encoding::UTF_8)).to eq('😺hello world') - end - - it 'appends UTF-8 data' do - data_store.append_data(model, +'Résumé', 4) - - expect(data.encoding).to eq(Encoding::ASCII_8BIT) - expect(data.force_encoding(Encoding::UTF_8)).to eq("😺Résumé") - end - - context 'when initial data is UTF-8' do - let(:initial_data) { +'😺' } + expect(data.encoding).to eq(Encoding::ASCII_8BIT) + expect(data.force_encoding(Encoding::UTF_8)).to eq('😺hello world') + end - it 'appends ASCII data' do - data_store.append_data(model, +'hello world', 4) + it 'appends UTF-8 data' do + data_store.append_data(model, +'Résumé', 4) - expect(data.encoding).to eq(Encoding::ASCII_8BIT) - expect(data.force_encoding(Encoding::UTF_8)).to eq('😺hello world') - end - end + expect(data.encoding).to eq(Encoding::ASCII_8BIT) + expect(data.force_encoding(Encoding::UTF_8)).to eq("😺Résumé") end - context 'when ci_job_trace_force_encode is disabled' do - before do - stub_feature_flags(ci_job_trace_force_encode: false) - end + context 'when initial data is UTF-8' do + let(:initial_data) { +'😺' } it 'appends ASCII data' do data_store.append_data(model, +'hello world', 4) @@ -145,11 +130,6 @@ RSpec.describe Ci::BuildTraceChunks::Fog do expect(data.encoding).to eq(Encoding::ASCII_8BIT) expect(data.force_encoding(Encoding::UTF_8)).to eq('😺hello world') end - - it 'throws an exception when appending UTF-8 data' do - expect(Gitlab::ErrorTracking).to receive(:track_and_raise_exception).and_call_original - expect { data_store.append_data(model, +'Résumé', 4) }.to raise_exception(Encoding::CompatibilityError) - end end end |