Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2016-11-28 23:33:12 +0300
committerRobert Schilling <rschilling@student.tugraz.at>2016-12-04 18:52:42 +0300
commit8b5c16e4b1d54745ba6ca65ecfbf14c1683db3b4 (patch)
tree75921dd684e623cc8291626206c1e42351d6c6ff /spec/requests
parentbd67459131e22273b502eb27d97709827ff42262 (diff)
API: Ability to remove source branch
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/merge_requests_spec.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb
index 918a71129f7..894896b95e4 100644
--- a/spec/requests/api/merge_requests_spec.rb
+++ b/spec/requests/api/merge_requests_spec.rb
@@ -234,11 +234,14 @@ describe API::MergeRequests, api: true do
target_branch: 'master',
author: user,
labels: 'label, label2',
- milestone_id: milestone.id
+ milestone_id: milestone.id,
+ remove_source_branch: true
+
expect(response).to have_http_status(201)
expect(json_response['title']).to eq('Test merge_request')
expect(json_response['labels']).to eq(['label', 'label2'])
expect(json_response['milestone']['id']).to eq(milestone.id)
+ expect(json_response['force_remove_source_branch']).to be_truthy
end
it "returns 422 when source_branch equals target_branch" do
@@ -511,6 +514,13 @@ describe API::MergeRequests, api: true do
expect(json_response['target_branch']).to eq('wiki')
end
+ it "returns merge_request that removes the source branch" do
+ put api("/projects/#{project.id}/merge_requests/#{merge_request.id}", user), remove_source_branch: true
+
+ expect(response).to have_http_status(200)
+ expect(json_response['force_remove_source_branch']).to be_truthy
+ end
+
it 'allows special label names' do
put api("/projects/#{project.id}/merge_requests/#{merge_request.id}", user),
title: 'new issue',