Commit 694666cf authored by Alex Kalderimis's avatar Alex Kalderimis

Remove references to to service

parent b8c957ad
......@@ -246,11 +246,11 @@ class Integration < ApplicationRecord
# Example: ["asana", ...]
# @deprecated
def self.available_integration_names(include_project_specific: true, include_dev: true)
service_names = integration_names
service_names += project_specific_integration_names if include_project_specific
service_names += dev_integration_names if include_dev
names = integration_names
names += project_specific_integration_names if include_project_specific
names += dev_integration_names if include_dev
service_names.sort_by(&:downcase)
names.sort_by(&:downcase)
end
def self.integration_names
......
......@@ -110,7 +110,7 @@ module API
destroy_conditionally!(integration) do
attrs = service_attributes(integration).index_with { nil }.merge(active: false)
render_api_error!('400 Bad Request', 400) unless service.update(attrs)
render_api_error!('400 Bad Request', 400) unless integration.update(attrs)
end
end
......
......@@ -185,9 +185,9 @@ RSpec.describe Integration do
let(:project) { build(:project, :repository) }
it 'test runs execute' do
expect(service).to receive(:execute).with(data)
expect(integration).to receive(:execute).with(data)
service.test(data)
integration.test(data)
end
end
......@@ -195,9 +195,9 @@ RSpec.describe Integration do
let(:project) { build(:project) }
it 'test runs execute' do
expect(service).to receive(:execute).with(data)
expect(integration).to receive(:execute).with(data)
service.test(data)
integration.test(data)
end
end
end
......
......@@ -24,11 +24,11 @@ RSpec.describe API::Services do
expect(response).to have_gitlab_http_status(:forbidden)
end
context 'project with services' do
context 'with integrations' do
let!(:active_integration) { create(:emails_on_push_integration, project: project, active: true) }
let!(:integration) { create(:custom_issue_tracker_integration, project: project, active: false) }
it "returns a list of all active services" do
it "returns a list of all active integrations" do
get api("/projects/#{project.id}/services", user)
aggregate_failures 'expect successful response with all active services' do
......@@ -141,7 +141,7 @@ RSpec.describe API::Services do
expect(json_response['properties'].keys).to match_array(service_instance.api_field_names)
end
it "returns all properties of inactive service #{service}" do
it "returns all properties of inactive integration #{service}" do
deactive_service!
get api("/projects/#{project.id}/services/#{dashed_service}", user)
......@@ -151,16 +151,16 @@ RSpec.describe API::Services do
expect(json_response['properties'].keys).to match_array(service_instance.api_field_names)
end
it "returns not found if service does not exist" do
it "returns not found if integration does not exist" do
get api("/projects/#{project2.id}/services/#{dashed_service}", user)
expect(response).to have_gitlab_http_status(:not_found)
expect(json_response['message']).to eq('404 Service Not Found')
end
it "returns not found if service exists but is in `Project#disabled_services`" do
it "returns not found if service exists but is in `Project#disabled_integrations`" do
expect_next_found_instance_of(Project) do |project|
expect(project).to receive(:disabled_services).at_least(:once).and_return([service])
expect(project).to receive(:disabled_integrations).at_least(:once).and_return([service])
end
get api("/projects/#{project.id}/services/#{dashed_service}", user)
......
......@@ -66,7 +66,7 @@ Integration.available_integration_names.each do |service|
return unless licensed_feature
stub_licensed_features(licensed_feature => true)
project.clear_memoization(:disabled_services)
project.clear_memoization(:disabled_integrations)
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment