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
Léo-Paul Géneau
gitlab-ce
Commits
c2e2cde9
Commit
c2e2cde9
authored
Oct 25, 2016
by
Borja Aparicio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added API spec test for projects/owned endpoint
parent
55e0065b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+24
-0
No files found.
spec/requests/api/projects_spec.rb
View file @
c2e2cde9
...
...
@@ -175,6 +175,30 @@ describe API::API, api: true do
end
end
describe
'GET /projects/owned'
do
before
do
project3
project4
end
context
'when unauthenticated'
do
it
'returns authentication error'
do
get
api
(
'/projects/owned'
)
expect
(
response
).
to
have_http_status
(
401
)
end
end
context
'when authenticated as project owner'
do
it
'returns an array of projects the user owns'
do
get
api
(
'/projects/owned'
,
user4
)
expect
(
response
).
to
have_http_status
(
200
)
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
.
first
[
'name'
]).
to
eq
(
project4
.
name
)
expect
(
json_response
.
first
[
'owner'
][
'username'
]).
to
eq
(
user4
.
username
)
end
end
end
describe
'GET /projects/visible'
do
let
(
:public_project
)
{
create
(
:project
,
:public
)
}
...
...
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