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
Boxiang Sun
gitlab-ce
Commits
de605ad1
Commit
de605ad1
authored
6 years ago
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for Pipeline DELETE for developers
parent
b7e5f73c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
4 deletions
+21
-4
spec/requests/api/pipelines_spec.rb
spec/requests/api/pipelines_spec.rb
+21
-4
No files found.
spec/requests/api/pipelines_spec.rb
View file @
de605ad1
...
...
@@ -473,11 +473,28 @@ describe API::Pipelines do
end
context
'unauthorized user'
do
it
'should return a 404'
do
get
api
(
"/projects/
#{
project
.
id
}
/pipelines/
#{
pipeline
.
id
}
"
,
non_member
)
context
'when user is not member'
do
it
'should return a 404'
do
delete
api
(
"/projects/
#{
project
.
id
}
/pipelines/
#{
pipeline
.
id
}
"
,
non_member
)
expect
(
response
).
to
have_gitlab_http_status
(
404
)
expect
(
json_response
[
'message'
]).
to
eq
'404 Project Not Found'
expect
(
response
).
to
have_gitlab_http_status
(
404
)
expect
(
json_response
[
'message'
]).
to
eq
'404 Project Not Found'
end
end
context
'when user is developer'
do
let
(
:developer
)
{
create
(
:user
)
}
before
do
project
.
add_developer
(
developer
)
end
it
'should return a 403'
do
delete
api
(
"/projects/
#{
project
.
id
}
/pipelines/
#{
pipeline
.
id
}
"
,
developer
)
expect
(
response
).
to
have_gitlab_http_status
(
403
)
expect
(
json_response
[
'message'
]).
to
eq
'403 Forbidden'
end
end
end
end
...
...
This diff is collapsed.
Click to expand it.
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