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
56016b7b
Commit
56016b7b
authored
Jun 05, 2017
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change test to verify N+1 queries are not made
parent
71cc0c4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
spec/services/issue_links/list_service_spec.rb
spec/services/issue_links/list_service_spec.rb
+12
-3
No files found.
spec/services/issue_links/list_service_spec.rb
View file @
56016b7b
...
...
@@ -36,9 +36,18 @@ describe IssueLinks::ListService, service: true do
target:
issue_b
)
end
it
'verifies number of queries'
do
recorded
=
ActiveRecord
::
QueryRecorder
.
new
{
subject
}
expect
(
recorded
.
count
).
to
be_within
(
1
).
of
(
37
)
it
'ensures no N+1 queries are made'
do
control_count
=
ActiveRecord
::
QueryRecorder
.
new
{
subject
}.
count
project
=
create
:empty_project
,
:public
issue_x
=
create
:issue
,
project:
project
issue_y
=
create
:issue
,
project:
project
issue_z
=
create
:issue
,
project:
project
create
:issue_link
,
source:
issue_x
,
target:
issue_y
create
:issue_link
,
source:
issue_x
,
target:
issue_z
create
:issue_link
,
source:
issue_y
,
target:
issue_z
expect
{
subject
}.
not_to
exceed_query_limit
(
control_count
)
end
it
'returns related issues JSON'
do
...
...
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