diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-04-30 15:43:32 +0200 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-04-30 15:46:36 +0200 |
commit | 7e0eb486ed150c0447bf245bdebe250f1771f7dc (patch) | |
tree | 43480d468a2ad7ed624d67523fbed40f6b5a3e6a /spec/requests | |
parent | 39a55bdf1a1613f362bcd7da444b291210454160 (diff) | |
download | gitlab-ce-7e0eb486ed150c0447bf245bdebe250f1771f7dc.tar.gz |
Don't allow a merge request to be merged when its title starts with "WIP".
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/merge_requests_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb index 9e252441a4f..5fca831f9be 100644 --- a/spec/requests/api/merge_requests_spec.rb +++ b/spec/requests/api/merge_requests_spec.rb @@ -312,6 +312,13 @@ describe API::API, api: true do expect(json_response['message']).to eq('405 Method Not Allowed') end + it "should return 405 if merge_request is a work in progress" do + merge_request.update_attribute(:title, "WIP: #{merge_request.title}") + put api("/projects/#{project.id}/merge_request/#{merge_request.id}/merge", user) + expect(response.status).to eq(405) + expect(json_response['message']).to eq('405 Method Not Allowed') + end + it "should return 401 if user has no permissions to merge" do user2 = create(:user) project.team << [user2, :reporter] |