diff options
| author | Robert Schilling <rschilling@student.tugraz.at> | 2016-04-13 16:30:20 +0200 |
|---|---|---|
| committer | Robert Schilling <rschilling@student.tugraz.at> | 2016-04-13 17:15:42 +0200 |
| commit | a9200d93d3e3d586302887fcaa0cf8f5fbd9a613 (patch) | |
| tree | 52c4b9e8783c5787c61fe57aa9e53bd3260925df /spec | |
| parent | fa3009095fbb995550a20e5d0cbc994f4290fbea (diff) | |
| download | gitlab-ce-a9200d93d3e3d586302887fcaa0cf8f5fbd9a613.tar.gz | |
Ensure that issues and merge requests are found
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/requests/api/issues_spec.rb | 6 | ||||
| -rw-r--r-- | spec/requests/api/merge_requests_spec.rb | 12 |
2 files changed, 15 insertions, 3 deletions
diff --git a/spec/requests/api/issues_spec.rb b/spec/requests/api/issues_spec.rb index 8361a1649e0..86ea223f206 100644 --- a/spec/requests/api/issues_spec.rb +++ b/spec/requests/api/issues_spec.rb @@ -594,20 +594,20 @@ describe API::API, api: true do describe 'DELETE :id/issues/:issue_id/subscription' do it 'unsubscribes from an issue' do - post api("/projects/#{project.id}/issues/#{issue.id}/subscription", user) + delete api("/projects/#{project.id}/issues/#{issue.id}/subscription", user) expect(response.status).to eq(200) expect(json_response['subscribed']).to eq(false) end it 'returns 304 if not subscribed' do - post api("/projects/#{project.id}/issues/#{issue.id}/subscription", user2) + delete api("/projects/#{project.id}/issues/#{issue.id}/subscription", user2) expect(response.status).to eq(304) end it 'returns 404 if the issue is not found' do - post api("/projects/#{project.id}/issues/123/subscription", user) + delete api("/projects/#{project.id}/issues/123/subscription", user) expect(response.status).to eq(404) end diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb index c247fcf9c96..1fa7e76894f 100644 --- a/spec/requests/api/merge_requests_spec.rb +++ b/spec/requests/api/merge_requests_spec.rb @@ -529,6 +529,12 @@ describe API::API, api: true do expect(response.status).to eq(304) end + + it 'returns 404 if the merge request is not found' do + post api("/projects/#{project.id}/merge_requests/123/subscription", user) + + expect(response.status).to eq(404) + end end describe 'DELETE :id/merge_requests/:merge_request_id/subscription' do @@ -544,6 +550,12 @@ describe API::API, api: true do expect(response.status).to eq(304) end + + it 'returns 404 if the merge request is not found' do + post api("/projects/#{project.id}/merge_requests/123/subscription", user) + + expect(response.status).to eq(404) + end end def mr_with_later_created_and_updated_at_time |
