diff options
Diffstat (limited to 'spec/requests/api/environments_spec.rb')
-rw-r--r-- | spec/requests/api/environments_spec.rb | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/spec/requests/api/environments_spec.rb b/spec/requests/api/environments_spec.rb index f8cd529a06c..3665cfd7241 100644 --- a/spec/requests/api/environments_spec.rb +++ b/spec/requests/api/environments_spec.rb @@ -25,7 +25,7 @@ describe API::Environments do get api("/projects/#{project.id}/environments", user) - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(response).to include_pagination_headers expect(json_response).to be_an Array expect(json_response.size).to eq(1) @@ -39,7 +39,7 @@ describe API::Environments do it 'returns a 404 status code' do get api("/projects/#{project.id}/environments", non_member) - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end @@ -49,7 +49,7 @@ describe API::Environments do it 'creates a environment with valid params' do post api("/projects/#{project.id}/environments", user), name: "mepmep" - expect(response).to have_http_status(201) + expect(response).to have_gitlab_http_status(201) expect(json_response['name']).to eq('mepmep') expect(json_response['slug']).to eq('mepmep') expect(json_response['external']).to be nil @@ -58,19 +58,19 @@ describe API::Environments do it 'requires name to be passed' do post api("/projects/#{project.id}/environments", user), external_url: 'test.gitlab.com' - expect(response).to have_http_status(400) + expect(response).to have_gitlab_http_status(400) end it 'returns a 400 if environment already exists' do post api("/projects/#{project.id}/environments", user), name: environment.name - expect(response).to have_http_status(400) + expect(response).to have_gitlab_http_status(400) end it 'returns a 400 if slug is specified' do post api("/projects/#{project.id}/environments", user), name: "foo", slug: "foo" - expect(response).to have_http_status(400) + expect(response).to have_gitlab_http_status(400) expect(json_response["error"]).to eq("slug is automatically generated and cannot be changed") end end @@ -79,7 +79,7 @@ describe API::Environments do it 'rejects the request' do post api("/projects/#{project.id}/environments", non_member), name: 'gitlab.com' - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end it 'returns a 400 when the required params are missing' do @@ -94,7 +94,7 @@ describe API::Environments do put api("/projects/#{project.id}/environments/#{environment.id}", user), name: 'Mepmep', external_url: url - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(json_response['name']).to eq('Mepmep') expect(json_response['external_url']).to eq(url) end @@ -104,7 +104,7 @@ describe API::Environments do api_url = api("/projects/#{project.id}/environments/#{environment.id}", user) put api_url, slug: slug + "-foo" - expect(response).to have_http_status(400) + expect(response).to have_gitlab_http_status(400) expect(json_response["error"]).to eq("slug is automatically generated and cannot be changed") end @@ -113,7 +113,7 @@ describe API::Environments do put api("/projects/#{project.id}/environments/#{environment.id}", user), name: 'Mepmep' - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) expect(json_response['name']).to eq('Mepmep') expect(json_response['external_url']).to eq(url) end @@ -121,7 +121,7 @@ describe API::Environments do it 'returns a 404 if the environment does not exist' do put api("/projects/#{project.id}/environments/12345", user) - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end @@ -130,13 +130,13 @@ describe API::Environments do it 'returns a 200 for an existing environment' do delete api("/projects/#{project.id}/environments/#{environment.id}", user) - expect(response).to have_http_status(204) + expect(response).to have_gitlab_http_status(204) end it 'returns a 404 for non existing id' do delete api("/projects/#{project.id}/environments/12345", user) - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) expect(json_response['message']).to eq('404 Not found') end @@ -149,7 +149,7 @@ describe API::Environments do it 'rejects the request' do delete api("/projects/#{project.id}/environments/#{environment.id}", non_member) - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end @@ -164,7 +164,7 @@ describe API::Environments do end it 'returns a 200' do - expect(response).to have_http_status(200) + expect(response).to have_gitlab_http_status(200) end it 'actually stops the environment' do @@ -175,7 +175,7 @@ describe API::Environments do it 'returns a 404 for non existing id' do post api("/projects/#{project.id}/environments/12345/stop", user) - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) expect(json_response['message']).to eq('404 Not found') end end @@ -184,7 +184,7 @@ describe API::Environments do it 'rejects the request' do post api("/projects/#{project.id}/environments/#{environment.id}/stop", non_member) - expect(response).to have_http_status(404) + expect(response).to have_gitlab_http_status(404) end end end |