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
105ac2b6
Commit
105ac2b6
authored
Dec 03, 2019
by
Andreas Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add regression spec
https://gitlab.com/gitlab-org/gitlab/issues/37919
parent
63534f6e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+29
-0
No files found.
spec/requests/api/projects_spec.rb
View file @
105ac2b6
...
...
@@ -155,6 +155,35 @@ describe API::Projects do
project4
end
# This is a regression spec for https://gitlab.com/gitlab-org/gitlab/issues/37919
context
'batch counting forks and open issues and refreshing count caches'
do
# We expect to count these projects (only the ones on the first page, not all matching ones)
let
(
:projects
)
{
Project
.
public_to_user
(
nil
).
order
(
id: :desc
).
first
(
per_page
)
}
let
(
:per_page
)
{
2
}
let
(
:count_service
)
{
double
}
before
do
# Create more projects, so we have more than one page
create_list
(
:project
,
5
,
:public
)
end
it
'batch counts project forks'
do
expect
(
::
Projects
::
BatchForksCountService
).
to
receive
(
:new
).
with
(
projects
).
and_return
(
count_service
)
expect
(
count_service
).
to
receive
(
:refresh_cache
)
get
api
(
"/projects?per_page=
#{
per_page
}
"
)
expect
(
response
.
status
).
to
eq
200
end
it
'batch counts open issues'
do
expect
(
::
Projects
::
BatchOpenIssuesCountService
).
to
receive
(
:new
).
with
(
projects
).
and_return
(
count_service
)
expect
(
count_service
).
to
receive
(
:refresh_cache
)
get
api
(
"/projects?per_page=
#{
per_page
}
"
)
expect
(
response
.
status
).
to
eq
200
end
end
context
'when unauthenticated'
do
it_behaves_like
'projects response'
do
let
(
:filter
)
{
{
search:
project
.
name
}
}
...
...
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