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
Jérome Perrin
gitlab-ce
Commits
c87d93d4
Commit
c87d93d4
authored
Dec 19, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve specs for Repositories API
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
2e6c1720
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
266 additions
and
114 deletions
+266
-114
changelogs/unreleased/4269-public-repositories-api.yml
changelogs/unreleased/4269-public-repositories-api.yml
+1
-1
spec/requests/api/repositories_spec.rb
spec/requests/api/repositories_spec.rb
+223
-113
spec/support/api/status_shared_examples.rb
spec/support/api/status_shared_examples.rb
+42
-0
No files found.
changelogs/unreleased/4269-public-repositories-api.yml
View file @
c87d93d4
---
---
title
:
Allow Repositories API GET endpoints to be requested anonymously
title
:
Allow Repositories API GET endpoints to be requested anonymously
merge_request
:
merge_request
:
8148
author
:
author
:
spec/requests/api/repositories_spec.rb
View file @
c87d93d4
This diff is collapsed.
Click to expand it.
spec/support/api/status_shared_examples.rb
0 → 100644
View file @
c87d93d4
# Specs for status checking.
#
# Requires an API request:
# let(:request) { get api("/projects/#{project.id}/repository/branches", user) }
shared_examples_for
'400 response'
do
before
do
# Fires the request
request
end
it
'returns 400'
do
expect
(
response
).
to
have_http_status
(
400
)
end
end
shared_examples_for
'403 response'
do
before
do
# Fires the request
request
end
it
'returns 403'
do
expect
(
response
).
to
have_http_status
(
403
)
end
end
shared_examples_for
'404 response'
do
let
(
:message
)
{
nil
}
before
do
# Fires the request
request
end
it
'returns 404'
do
expect
(
response
).
to
have_http_status
(
404
)
expect
(
json_response
).
to
be_an
Object
if
message
.
present?
expect
(
json_response
[
'message'
]).
to
eq
(
message
)
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