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
ff1e3a47
Commit
ff1e3a47
authored
Oct 30, 2017
by
Mark Fletcher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix namespacing for MergeWhenPipelineSucceedsService in MR API
parent
bb63ee68
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
1 deletion
+30
-1
changelogs/unreleased/39619-cancel-merge-when-pipeline-succeeds-from-the-api-fails.yml
...ancel-merge-when-pipeline-succeeds-from-the-api-fails.yml
+5
-0
lib/api/merge_requests.rb
lib/api/merge_requests.rb
+1
-1
spec/requests/api/merge_requests_spec.rb
spec/requests/api/merge_requests_spec.rb
+24
-0
No files found.
changelogs/unreleased/39619-cancel-merge-when-pipeline-succeeds-from-the-api-fails.yml
0 → 100644
View file @
ff1e3a47
---
title
:
Fix namespacing for MergeWhenPipelineSucceedsService in MR API
merge_request
:
author
:
type
:
fixed
lib/api/merge_requests.rb
View file @
ff1e3a47
...
...
@@ -295,7 +295,7 @@ module API
unauthorized!
unless
merge_request
.
can_cancel_merge_when_pipeline_succeeds?
(
current_user
)
::
MergeRequest
::
MergeWhenPipelineSucceedsService
::
MergeRequest
s
::
MergeWhenPipelineSucceedsService
.
new
(
merge_request
.
target_project
,
current_user
)
.
cancel
(
merge_request
)
end
...
...
spec/requests/api/merge_requests_spec.rb
View file @
ff1e3a47
...
...
@@ -1061,6 +1061,30 @@ describe API::MergeRequests do
end
end
describe
'POST :id/merge_requests/:merge_request_iid/cancel_merge_when_pipeline_succeeds'
do
before
do
::
MergeRequests
::
MergeWhenPipelineSucceedsService
.
new
(
merge_request
.
target_project
,
user
).
execute
(
merge_request
)
end
it
'removes the merge_when_pipeline_succeeds status'
do
post
api
(
"/projects/
#{
project
.
id
}
/merge_requests/
#{
merge_request
.
iid
}
/cancel_merge_when_pipeline_succeeds"
,
user
)
expect
(
response
).
to
have_gitlab_http_status
(
201
)
end
it
'returns 404 if the merge request is not found'
do
post
api
(
"/projects/
#{
project
.
id
}
/merge_requests/123/merge_when_pipeline_succeeds"
,
user
)
expect
(
response
).
to
have_gitlab_http_status
(
404
)
end
it
'returns 404 if the merge request id is used instead of iid'
do
post
api
(
"/projects/
#{
project
.
id
}
/merge_requests/
#{
merge_request
.
id
}
/merge_when_pipeline_succeeds"
,
user
)
expect
(
response
).
to
have_gitlab_http_status
(
404
)
end
end
describe
'Time tracking'
do
let
(
:issuable
)
{
merge_request
}
...
...
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