2017-02-20 19:32:44 +00:00
|
|
|
require "spec_helper"
|
|
|
|
|
2017-04-21 20:32:02 +00:00
|
|
|
describe API::V3::Services do
|
2017-02-20 19:32:44 +00:00
|
|
|
let(:user) { create(:user) }
|
2017-08-02 19:55:11 +00:00
|
|
|
let(:project) { create(:project, creator_id: user.id, namespace: user.namespace) }
|
2017-02-20 19:32:44 +00:00
|
|
|
|
2017-03-07 16:57:42 +00:00
|
|
|
available_services = Service.available_services_names
|
|
|
|
available_services.delete('prometheus')
|
|
|
|
available_services.each do |service|
|
2017-02-20 19:32:44 +00:00
|
|
|
describe "DELETE /projects/:id/services/#{service.dasherize}" do
|
|
|
|
include_context service
|
|
|
|
|
|
|
|
it "deletes #{service}" do
|
|
|
|
delete v3_api("/projects/#{project.id}/services/#{dashed_service}", user)
|
|
|
|
|
|
|
|
expect(response).to have_http_status(200)
|
|
|
|
project.send(service_method).reload
|
|
|
|
expect(project.send(service_method).activated?).to be_falsey
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|