summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/encoding_helper_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-09-20 13:18:24 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-09-20 13:18:24 +0000
commit0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch)
tree4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /spec/lib/gitlab/encoding_helper_spec.rb
parent744144d28e3e7fddc117924fef88de5d9674fe4c (diff)
downloadgitlab-ce-0653e08efd039a5905f3fa4f6e9cef9f5d2f799c.tar.gz
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'spec/lib/gitlab/encoding_helper_spec.rb')
-rw-r--r--spec/lib/gitlab/encoding_helper_spec.rb30
1 files changed, 1 insertions, 29 deletions
diff --git a/spec/lib/gitlab/encoding_helper_spec.rb b/spec/lib/gitlab/encoding_helper_spec.rb
index 268ac5dcc21..98170ef437c 100644
--- a/spec/lib/gitlab/encoding_helper_spec.rb
+++ b/spec/lib/gitlab/encoding_helper_spec.rb
@@ -241,7 +241,7 @@ RSpec.describe Gitlab::EncodingHelper do
let(:data) { binary_string }
let(:kwargs) { {} }
- shared_examples 'detects encoding' do
+ context 'detects encoding' do
it { is_expected.to be_a(Hash) }
it 'correctly detects the binary' do
@@ -264,33 +264,5 @@ RSpec.describe Gitlab::EncodingHelper do
end
end
end
-
- context 'cached_encoding_detection is enabled' do
- before do
- stub_feature_flags(cached_encoding_detection: true)
- end
-
- it_behaves_like 'detects encoding'
-
- context 'cache_key is provided' do
- let(:kwargs) do
- { cache_key: %w(foo bar) }
- end
-
- it 'uses that cache_key to serve from the cache' do
- expect(Rails.cache).to receive(:fetch).with([:detect_binary, CharlockHolmes::VERSION, %w(foo bar)], expires_in: 1.week).and_call_original
-
- expect(subject[:type]).to eq(:binary)
- end
- end
- end
-
- context 'cached_encoding_detection is disabled' do
- before do
- stub_feature_flags(cached_encoding_detection: false)
- end
-
- it_behaves_like 'detects encoding'
- end
end
end