diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2016-11-28 21:16:15 +0300 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2016-11-30 15:13:50 +0300 |
commit | 2ce66c071fc7ab2b8ca881223321a3927ec7d61e (patch) | |
tree | c172fb1a5112e7579a663313e766b80642568e58 /spec/requests | |
parent | 060ec3d77d3d4a1e81510e07469db411fb66e3bd (diff) |
API: Expose branch status
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/branches_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/requests/api/branches_spec.rb b/spec/requests/api/branches_spec.rb index fe6b875b997..28fbae18de1 100644 --- a/spec/requests/api/branches_spec.rb +++ b/spec/requests/api/branches_spec.rb @@ -31,11 +31,22 @@ describe API::API, api: true do expect(json_response['name']).to eq(branch_name) expect(json_response['commit']['id']).to eq(branch_sha) + expect(json_response['merged']).to eq(false) expect(json_response['protected']).to eq(false) expect(json_response['developers_can_push']).to eq(false) expect(json_response['developers_can_merge']).to eq(false) end + context 'on a merged branch' do + it "returns the branch information for a single branch" do + get api("/projects/#{project.id}/repository/branches/merge-test", user) + + expect(response).to have_http_status(200) + expect(json_response['name']).to eq('merge-test') + expect(json_response['merged']).to eq(true) + end + end + it "returns a 403 error if guest" do get api("/projects/#{project.id}/repository/branches", user2) expect(response).to have_http_status(403) |