summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2019-02-25 13:59:17 +0000
committerNick Thomas <nick@gitlab.com>2019-02-25 14:09:48 +0000
commitc85a768ca5d8c53b7770fdc4dc8f9eeef237b8c8 (patch)
treeac87d4bb3eac28cdb8a498ff9d40a405651e9a39 /spec/requests
parentd93d799bde3ee8082c1fd04387bd9bf0979a212d (diff)
downloadgitlab-ce-c85a768ca5d8c53b7770fdc4dc8f9eeef237b8c8.tar.gz
Respect the should_remove_source_branch parameter to the merge API
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/merge_requests_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb
index b8426126bc6..b4cd3130dc5 100644
--- a/spec/requests/api/merge_requests_spec.rb
+++ b/spec/requests/api/merge_requests_spec.rb
@@ -984,6 +984,21 @@ describe API::MergeRequests do
expect(squash_commit.message).to eq(merge_request.default_squash_commit_message)
end
end
+
+ describe "the should_remove_source_branch param" do
+ let(:source_repository) { merge_request.source_project.repository }
+ let(:source_branch) { merge_request.source_branch }
+
+ it 'removes the source branch when set' do
+ put(
+ api("/projects/#{project.id}/merge_requests/#{merge_request.iid}/merge", user),
+ params: { should_remove_source_branch: true }
+ )
+
+ expect(response).to have_gitlab_http_status(200)
+ expect(source_repository.branch_exists?(source_branch)).to be_falsy
+ end
+ end
end
describe "PUT /projects/:id/merge_requests/:merge_request_iid" do