Commit f3c0c515 authored by Rajendra Kadam's avatar Rajendra Kadam Committed by Peter Leitzen

Add class stub in query limit helper spec

parent 3be73a7e
......@@ -374,7 +374,6 @@ RSpec/LeakyConstantDeclaration:
- 'spec/services/clusters/applications/check_installation_progress_service_spec.rb'
- 'spec/services/clusters/applications/check_uninstall_progress_service_spec.rb'
- 'spec/support/shared_examples/quick_actions/issuable/issuable_quick_actions_shared_examples.rb'
- 'spec/support_specs/matchers/exceed_query_limit_helpers_spec.rb'
RSpec/EmptyLineAfterHook:
Enabled: false
......
---
title: Add class stubs and fix leaky constant alert in query limit helper spec
merge_request: 31949
author: Rajendra Kadam
type: fixed
......@@ -3,11 +3,15 @@
require 'spec_helper'
describe ExceedQueryLimitHelpers do
class TestQueries < ActiveRecord::Base
before do
stub_const('TestQueries', Class.new(ActiveRecord::Base))
stub_const('TestMatcher', Class.new)
TestQueries.class_eval do
self.table_name = 'schema_migrations'
end
class TestMatcher
TestMatcher.class_eval do
include ExceedQueryLimitHelpers
def expected
......@@ -16,6 +20,7 @@ describe ExceedQueryLimitHelpers do
end
end
end
end
it 'does not contain marginalia annotations' do
test_matcher = TestMatcher.new
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment