Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f3c0c515
Commit
f3c0c515
authored
May 21, 2020
by
Rajendra Kadam
Committed by
Peter Leitzen
May 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add class stub in query limit helper spec
parent
3be73a7e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
9 deletions
+18
-9
.rubocop.yml
.rubocop.yml
+0
-1
changelogs/unreleased/leaky-constant-fix-3.yml
changelogs/unreleased/leaky-constant-fix-3.yml
+5
-0
spec/support_specs/matchers/exceed_query_limit_helpers_spec.rb
...support_specs/matchers/exceed_query_limit_helpers_spec.rb
+13
-8
No files found.
.rubocop.yml
View file @
f3c0c515
...
...
@@ -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
...
...
changelogs/unreleased/leaky-constant-fix-3.yml
0 → 100644
View file @
f3c0c515
---
title
:
Add class stubs and fix leaky constant alert in query limit helper spec
merge_request
:
31949
author
:
Rajendra Kadam
type
:
fixed
spec/support_specs/matchers/exceed_query_limit_helpers_spec.rb
View file @
f3c0c515
...
...
@@ -3,16 +3,21 @@
require
'spec_helper'
describe
ExceedQueryLimitHelpers
do
class
TestQueries
<
ActiveRecord
::
Base
self
.
table_name
=
'schema_migrations'
end
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
include
ExceedQueryLimitHelpers
TestMatcher
.
class_eval
do
include
ExceedQueryLimitHelpers
def
expected
ActiveRecord
::
QueryRecorder
.
new
do
2
.
times
{
TestQueries
.
count
}
def
expected
ActiveRecord
::
QueryRecorder
.
new
do
2
.
times
{
TestQueries
.
count
}
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment