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
b50d5198
Commit
b50d5198
authored
Oct 31, 2016
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix spec/requests/api/deploy_keys_spec.rb after ce->ee
parent
e69c4c87
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
spec/requests/api/deploy_keys_spec.rb
spec/requests/api/deploy_keys_spec.rb
+14
-10
No files found.
spec/requests/api/deploy_keys_spec.rb
View file @
b50d5198
...
...
@@ -3,34 +3,38 @@ require 'spec_helper'
describe
API
::
API
,
api:
true
do
include
ApiHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:admin
)
{
create
(
:admin
)
}
let
(
:project
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let
(
:project2
)
{
create
(
:project
,
creator_id:
user
.
id
)
}
let!
(
:deploy_keys_project
)
{
create
(
:deploy_keys_project
,
project:
project
)
}
let
(
:admin
)
{
create
(
:admin
)
}
let
(
:deploy_key
)
{
create
(
:deploy_key
,
public:
true
)
}
describe
'GET /deploy_keys'
do
before
{
admin
}
let!
(
:deploy_keys_project
)
do
create
(
:deploy_keys_project
,
project:
project
,
deploy_key:
deploy_key
)
end
describe
'GET /deploy_keys'
do
context
'when unauthenticated'
do
it
'
returns
authentication error'
do
it
'
should return
authentication error'
do
get
api
(
'/deploy_keys'
)
expect
(
response
.
status
).
to
eq
(
401
)
end
end
context
'when authenticated as non-admin user'
do
it
'
returns
a 403 error'
do
it
'
should return
a 403 error'
do
get
api
(
'/deploy_keys'
,
user
)
expect
(
response
.
status
).
to
eq
(
403
)
end
end
context
'when authenticated as admin'
do
it
'
returns
all deploy keys'
do
it
'
should return
all deploy keys'
do
get
api
(
'/deploy_keys'
,
admin
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
response
.
status
).
to
eq
(
200
)
expect
(
json_response
).
to
be_an
Array
expect
(
json_response
.
first
[
'id'
]).
to
eq
(
deploy_keys_project
.
deploy_key
.
id
)
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