diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2019-02-13 22:51:53 +0100 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2019-08-26 10:45:37 +0200 |
commit | 41412f73604159ca735420396df73f7b6eef6f86 (patch) | |
tree | 64bac28e7e965699707331301995801fb5b6d330 /spec | |
parent | 2e83665ed30259a7908350d316605a9c100f0876 (diff) | |
download | gitlab-ce-41412f73604159ca735420396df73f7b6eef6f86.tar.gz |
Add docs and first specs
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/labels_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/requests/api/labels_spec.rb b/spec/requests/api/labels_spec.rb index f6640fe41d0..047e8b6c507 100644 --- a/spec/requests/api/labels_spec.rb +++ b/spec/requests/api/labels_spec.rb @@ -473,6 +473,29 @@ describe API::Labels do end end + describe 'POST /projects/:id/labels/promote' do + it 'returns 200 if label is promoted' do + post api("/projects/#{project.id}/labels/promote", user), params: { name: 'label1' } + + expect(response).to have_gitlab_http_status(200) + expect(json_response['name']).to eq(label1.name) + expect(json_response['color']).to eq('#FFFFFF') + end + + it 'returns 404 if label does not exist' do + post api("/projects/#{project.id}/labels/promote", user), params: { name: 'unknown' } + + expect(response).to have_gitlab_http_status(404) + end + + it 'returns 400 if no label name given' do + post api("/projects/#{project.id}/labels/promote", user) + + expect(response).to have_gitlab_http_status(400) + expect(json_response['error']).to eq('name is missing') + end + end + describe "POST /projects/:id/labels/:label_id/subscribe" do context "when label_id is a label title" do it "subscribes to the label" do |