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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
2531fb3b
Commit
2531fb3b
authored
Aug 28, 2017
by
Travis Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing N+1 test to issues spec
parent
6782b406
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
spec/requests/api/issues_spec.rb
spec/requests/api/issues_spec.rb
+12
-0
No files found.
spec/requests/api/issues_spec.rb
View file @
2531fb3b
...
...
@@ -509,6 +509,18 @@ describe API::Issues, :mailer do
describe
"GET /projects/:id/issues"
do
let
(
:base_url
)
{
"/projects/
#{
project
.
id
}
"
}
it
'avoids N+1 queries'
do
control_count
=
ActiveRecord
::
QueryRecorder
.
new
do
get
api
(
"/projects/
#{
project
.
id
}
/issues"
,
user
)
end
.
count
create
(
:issue
,
author:
user
,
project:
project
)
expect
do
get
api
(
"/projects/
#{
project
.
id
}
/issues"
,
user
)
end
.
not_to
exceed_query_limit
(
control_count
)
end
it
'returns 404 when project does not exist'
do
get
api
(
'/projects/1000/issues'
,
non_member
)
...
...
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