2017-08-17 22:00:37 +05:30
|
|
|
require "spec_helper"
|
|
|
|
|
|
|
|
describe API::V3::Services do
|
|
|
|
let(:user) { create(:user) }
|
2017-09-10 17:25:29 +05:30
|
|
|
let(:project) { create(:project, creator_id: user.id, namespace: user.namespace) }
|
2017-08-17 22:00:37 +05:30
|
|
|
|
|
|
|
available_services = Service.available_services_names
|
|
|
|
available_services.delete('prometheus')
|
|
|
|
available_services.each do |service|
|
|
|
|
describe "DELETE /projects/:id/services/#{service.dasherize}" do
|
|
|
|
include_context service
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
before do
|
|
|
|
initialize_service(service)
|
|
|
|
end
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
it "deletes #{service}" do
|
|
|
|
delete v3_api("/projects/#{project.id}/services/#{dashed_service}", user)
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
expect(response).to have_gitlab_http_status(200)
|
2017-08-17 22:00:37 +05:30
|
|
|
project.send(service_method).reload
|
|
|
|
expect(project.send(service_method).activated?).to be_falsey
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|