diff options
author | Abhi Rao <abhi.rao@onit.com> | 2016-03-29 02:41:00 +0300 |
---|---|---|
committer | Abhi Rao <abhi.rao@onit.com> | 2016-03-29 06:11:44 +0300 |
commit | 762d6ab4fd315d9d692d9df814cef206b39b9fdd (patch) | |
tree | e720182b967f657a5e1ebcc0541c6b228db4fbbb /spec/requests/api/merge_requests_spec.rb | |
parent | 3385696bcecd5bf9a68cd4130b8a79a0b3557c34 (diff) |
Ensuring Merge Request API returns boolean values for work_in_progress
Fixes #14692
Diffstat (limited to 'spec/requests/api/merge_requests_spec.rb')
-rw-r--r-- | spec/requests/api/merge_requests_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb index c9175a4d6eb..25fa30b2f21 100644 --- a/spec/requests/api/merge_requests_spec.rb +++ b/spec/requests/api/merge_requests_spec.rb @@ -118,6 +118,7 @@ describe API::API, api: true do expect(response.status).to eq(200) expect(json_response['title']).to eq(merge_request.title) expect(json_response['iid']).to eq(merge_request.iid) + expect(json_response['work_in_progress']).to eq(false) expect(json_response['merge_status']).to eq('can_be_merged') end @@ -133,6 +134,16 @@ describe API::API, api: true do get api("/projects/#{project.id}/merge_requests/999", user) expect(response.status).to eq(404) end + + context 'Work in Progress' do + let!(:merge_request_wip) { create(:merge_request, author: user, assignee: user, source_project: project, target_project: project, title: "WIP: Test", created_at: base_time + 1.second) } + + it "should return merge_request" do + get api("/projects/#{project.id}/merge_requests/#{merge_request_wip.id}", user) + expect(response.status).to eq(200) + expect(json_response['work_in_progress']).to eq(true) + end + end end describe 'GET /projects/:id/merge_requests/:merge_request_id/commits' do |