summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples/lib/cache_helpers_shared_examples.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/shared_examples/lib/cache_helpers_shared_examples.rb')
-rw-r--r--spec/support/shared_examples/lib/cache_helpers_shared_examples.rb53
1 files changed, 0 insertions, 53 deletions
diff --git a/spec/support/shared_examples/lib/cache_helpers_shared_examples.rb b/spec/support/shared_examples/lib/cache_helpers_shared_examples.rb
index 82a9e8130f7..2e00abe2f8e 100644
--- a/spec/support/shared_examples/lib/cache_helpers_shared_examples.rb
+++ b/spec/support/shared_examples/lib/cache_helpers_shared_examples.rb
@@ -54,31 +54,6 @@ RSpec.shared_examples_for 'object cache helper' do
allow(Gitlab::ApplicationContext).to receive(:current_context_attribute).with(:caller_id).and_return(caller_id)
end
- context 'when feature flag is off' do
- before do
- stub_feature_flags(add_timing_to_certain_cache_actions: false)
- end
-
- it 'does not call increment' do
- expect(transaction).not_to receive(:increment).with(:cached_object_operations_total, any_args)
-
- subject
- end
-
- it 'does not call histogram' do
- expect(Gitlab::Metrics).not_to receive(:histogram)
-
- subject
- end
-
- it "is valid JSON" do
- parsed = Gitlab::Json.parse(subject.to_s)
-
- expect(parsed).to be_a(Hash)
- expect(parsed["id"]).to eq(presentable.id)
- end
- end
-
it 'increments the counter' do
expect(transaction)
.to receive(:increment)
@@ -157,34 +132,6 @@ RSpec.shared_examples_for 'collection cache helper' do
allow(Gitlab::ApplicationContext).to receive(:current_context_attribute).with(:caller_id).and_return(caller_id)
end
- context 'when feature flag is off' do
- before do
- stub_feature_flags(add_timing_to_certain_cache_actions: false)
- end
-
- it 'does not call increment' do
- expect(transaction).not_to receive(:increment).with(:cached_object_operations_total, any_args)
-
- subject
- end
-
- it 'does not call histogram' do
- expect(Gitlab::Metrics).not_to receive(:histogram)
-
- subject
- end
-
- it "is valid JSON" do
- parsed = Gitlab::Json.parse(subject.to_s)
-
- expect(parsed).to be_an(Array)
-
- presentable.each_with_index do |item, i|
- expect(parsed[i]["id"]).to eq(item.id)
- end
- end
- end
-
context 'when presentable has a group by clause' do
let(:presentable) { MergeRequest.group(:id) }