diff options
author | Rémy Coutable <remy@rymai.me> | 2017-02-20 17:04:30 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-02-20 17:04:30 +0000 |
commit | 5f0e4619dc556a6d009856bff94c2a6c91fbabe9 (patch) | |
tree | 235c448dc589f57b23fb065f7b3f27cc34259798 /spec | |
parent | 2338ac73ad1aec7a2daf76bc1486e1da70fc879e (diff) | |
parent | 039c6d60fa2cc455956fb0016fc39f3e89a1a88f (diff) | |
download | gitlab-ce-5f0e4619dc556a6d009856bff94c2a6c91fbabe9.tar.gz |
Merge branch 'api-star-restful' into 'master'
API: Moved `DELETE /projects/:id/star` to `POST /projects/:id/unstar`
Closes #28328
See merge request !9328
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/projects_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index db70b63917e..4e90aae9279 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -1235,7 +1235,7 @@ describe API::Projects, api: true do end end - describe 'DELETE /projects/:id/star' do + describe 'POST /projects/:id/unstar' do context 'on a starred project' do before do user.toggle_star(project) @@ -1243,16 +1243,16 @@ describe API::Projects, api: true do end it 'unstars the project' do - expect { delete api("/projects/#{project.id}/star", user) }.to change { project.reload.star_count }.by(-1) + expect { post api("/projects/#{project.id}/unstar", user) }.to change { project.reload.star_count }.by(-1) - expect(response).to have_http_status(200) + expect(response).to have_http_status(201) expect(json_response['star_count']).to eq(0) end end context 'on an unstarred project' do it 'does not modify the star count' do - expect { delete api("/projects/#{project.id}/star", user) }.not_to change { project.reload.star_count } + expect { post api("/projects/#{project.id}/unstar", user) }.not_to change { project.reload.star_count } expect(response).to have_http_status(304) end |