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
2500424f
Commit
2500424f
authored
Jan 29, 2020
by
Aishwarya Subramanian
Committed by
André Hänsel
Mar 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added specs for project pagination
parent
a41000c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
2 deletions
+49
-2
spec/controllers/dashboard/projects_controller_spec.rb
spec/controllers/dashboard/projects_controller_spec.rb
+49
-2
No files found.
spec/controllers/dashboard/projects_controller_spec.rb
View file @
2500424f
...
@@ -86,11 +86,58 @@ describe Dashboard::ProjectsController do
...
@@ -86,11 +86,58 @@ describe Dashboard::ProjectsController do
end
end
describe
'GET /starred.json'
do
describe
'GET /starred.json'
do
subject
{
get
:starred
,
format: :json
}
let
(
:projects
)
{
create_list
(
:project
,
2
,
creator:
user
)
}
before
do
before
do
get
:starred
,
format: :json
allow
(
Kaminari
.
config
).
to
receive
(
:default_per_page
).
and_return
(
1
)
projects
.
each
do
|
project
|
project
.
add_developer
(
user
)
create
(
:users_star_project
,
project_id:
project
.
id
,
user_id:
user
.
id
)
end
end
end
it
{
is_expected
.
to
respond_with
(
:success
)
}
it
'returns success'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
it
'paginates the records'
do
subject
expect
(
assigns
(
:projects
).
count
).
to
eq
(
1
)
end
end
end
context
'atom requests'
do
let
(
:user
)
{
create
(
:user
)
}
before
do
sign_in
(
user
)
end
describe
'#index'
do
context
'project pagination'
do
let
(
:projects
)
{
create_list
(
:project
,
2
,
creator:
user
)
}
before
do
allow
(
Kaminari
.
config
).
to
receive
(
:default_per_page
).
and_return
(
1
)
projects
.
each
do
|
project
|
project
.
add_developer
(
user
)
end
end
it
'does not paginate projects, even if page number is passed'
do
get
:index
,
format: :atom
expect
(
assigns
(
:events
).
count
).
to
eq
(
2
)
end
end
end
end
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