Commit 39192335 authored by Kerri Miller's avatar Kerri Miller

Merge branch 'justin_ho-rename-routes-for-project-services-to-integrations' into 'master'

Rename routes for project services to "integrations"

See merge request gitlab-org/gitlab!77376
parents 8a831edf 7c604bd6
...@@ -20,7 +20,7 @@ class Projects::MattermostsController < Projects::ApplicationController ...@@ -20,7 +20,7 @@ class Projects::MattermostsController < Projects::ApplicationController
if result if result
flash[:notice] = 'This service is now configured' flash[:notice] = 'This service is now configured'
redirect_to edit_project_service_path(@project, integration) redirect_to edit_project_integration_path(@project, integration)
else else
flash[:alert] = message || 'Failed to configure service' flash[:alert] = message || 'Failed to configure service'
redirect_to new_project_mattermost_path(@project) redirect_to new_project_mattermost_path(@project)
......
...@@ -66,7 +66,7 @@ module Projects ...@@ -66,7 +66,7 @@ module Projects
) )
if @metric.persisted? if @metric.persisted?
redirect_to edit_project_service_path(project, ::Integrations::Prometheus), redirect_to edit_project_integration_path(project, ::Integrations::Prometheus),
notice: _('Metric was successfully added.') notice: _('Metric was successfully added.')
else else
render 'new' render 'new'
...@@ -77,7 +77,7 @@ module Projects ...@@ -77,7 +77,7 @@ module Projects
@metric = update_metrics_service(prometheus_metric).execute @metric = update_metrics_service(prometheus_metric).execute
if @metric.persisted? if @metric.persisted?
redirect_to edit_project_service_path(project, ::Integrations::Prometheus), redirect_to edit_project_integration_path(project, ::Integrations::Prometheus),
notice: _('Metric was successfully updated.') notice: _('Metric was successfully updated.')
else else
render 'edit' render 'edit'
...@@ -93,7 +93,7 @@ module Projects ...@@ -93,7 +93,7 @@ module Projects
respond_to do |format| respond_to do |format|
format.html do format.html do
redirect_to edit_project_service_path(project, ::Integrations::Prometheus), status: :see_other redirect_to edit_project_integration_path(project, ::Integrations::Prometheus), status: :see_other
end end
format.json do format.json do
head :ok head :ok
......
...@@ -7,13 +7,13 @@ class Projects::ServiceHookLogsController < Projects::HookLogsController ...@@ -7,13 +7,13 @@ class Projects::ServiceHookLogsController < Projects::HookLogsController
def retry def retry
execute_hook execute_hook
redirect_to edit_project_service_path(@project, @integration) redirect_to edit_project_integration_path(@project, @integration)
end end
private private
def integration def integration
@integration ||= @project.find_or_initialize_integration(params[:service_id]) @integration ||= @project.find_or_initialize_integration(params[:integration_id])
end end
override :hook override :hook
......
...@@ -66,7 +66,7 @@ class Projects::ServicesController < Projects::ApplicationController ...@@ -66,7 +66,7 @@ class Projects::ServicesController < Projects::ApplicationController
private private
def redirect_path def redirect_path
safe_redirect_path(params[:redirect_to]).presence || edit_project_service_path(project, integration) safe_redirect_path(params[:redirect_to]).presence || edit_project_integration_path(project, integration)
end end
def service_test_response def service_test_response
...@@ -119,7 +119,7 @@ class Projects::ServicesController < Projects::ApplicationController ...@@ -119,7 +119,7 @@ class Projects::ServicesController < Projects::ApplicationController
end end
def redirect_deprecated_prometheus_integration def redirect_deprecated_prometheus_integration
redirect_to edit_project_service_path(project, integration) if integration.is_a?(::Integrations::Prometheus) && Feature.enabled?(:settings_operations_prometheus_service, project) redirect_to edit_project_integration_path(project, integration) if integration.is_a?(::Integrations::Prometheus) && Feature.enabled?(:settings_operations_prometheus_service, project)
end end
def set_deprecation_notice_for_prometheus_integration def set_deprecation_notice_for_prometheus_integration
......
...@@ -5,7 +5,7 @@ module CustomMetricsHelper ...@@ -5,7 +5,7 @@ module CustomMetricsHelper
{ {
'custom-metrics-path' => url_for([project, metric]), 'custom-metrics-path' => url_for([project, metric]),
'metric-persisted' => metric.persisted?.to_s, 'metric-persisted' => metric.persisted?.to_s,
'edit-project-service-path' => edit_project_service_path(project, ::Integrations::Prometheus), 'edit-project-service-path' => edit_project_integration_path(project, ::Integrations::Prometheus),
'validate-query-path' => validate_query_project_prometheus_metrics_path(project), 'validate-query-path' => validate_query_project_prometheus_metrics_path(project),
'title' => metric.title.to_s, 'title' => metric.title.to_s,
'query' => metric.query.to_s, 'query' => metric.query.to_s,
......
...@@ -59,7 +59,7 @@ module EnvironmentsHelper ...@@ -59,7 +59,7 @@ module EnvironmentsHelper
return {} unless project return {} unless project
{ {
'settings_path' => edit_project_service_path(project, 'prometheus'), 'settings_path' => edit_project_integration_path(project, 'prometheus'),
'clusters_path' => project_clusters_path(project), 'clusters_path' => project_clusters_path(project),
'dashboards_endpoint' => project_performance_monitoring_dashboards_path(project, format: :json), 'dashboards_endpoint' => project_performance_monitoring_dashboards_path(project, format: :json),
'default_branch' => project.default_branch, 'default_branch' => project.default_branch,
......
...@@ -29,7 +29,7 @@ module IntegrationsHelper ...@@ -29,7 +29,7 @@ module IntegrationsHelper
def scoped_integration_path(integration, project: nil, group: nil) def scoped_integration_path(integration, project: nil, group: nil)
if project.present? if project.present?
project_service_path(project, integration) project_integration_path(project, integration)
elsif group.present? elsif group.present?
group_settings_integration_path(group, integration) group_settings_integration_path(group, integration)
else else
...@@ -39,7 +39,7 @@ module IntegrationsHelper ...@@ -39,7 +39,7 @@ module IntegrationsHelper
def scoped_edit_integration_path(integration, project: nil, group: nil) def scoped_edit_integration_path(integration, project: nil, group: nil)
if project.present? if project.present?
edit_project_service_path(project, integration) edit_project_integration_path(project, integration)
elsif group.present? elsif group.present?
edit_group_settings_integration_path(group, integration) edit_group_settings_integration_path(group, integration)
else else
...@@ -53,7 +53,7 @@ module IntegrationsHelper ...@@ -53,7 +53,7 @@ module IntegrationsHelper
def scoped_test_integration_path(integration, project: nil, group: nil) def scoped_test_integration_path(integration, project: nil, group: nil)
if project.present? if project.present?
test_project_service_path(project, integration) test_project_integration_path(project, integration)
elsif group.present? elsif group.present?
test_group_settings_integration_path(group, integration) test_group_settings_integration_path(group, integration)
else else
......
...@@ -4,10 +4,10 @@ class ServiceHookPresenter < Gitlab::View::Presenter::Delegated ...@@ -4,10 +4,10 @@ class ServiceHookPresenter < Gitlab::View::Presenter::Delegated
presents ::ServiceHook, as: :service_hook presents ::ServiceHook, as: :service_hook
def logs_details_path(log) def logs_details_path(log)
project_service_hook_log_path(integration.project, integration, log) project_integration_hook_log_path(integration.project, integration, log)
end end
def logs_retry_path(log) def logs_retry_path(log)
retry_project_service_hook_log_path(integration.project, integration, log) retry_project_integration_hook_log_path(integration.project, integration, log)
end end
end end
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
%td %td
%strong %strong
- if can?(current_user, :admin_project, project) - if can?(current_user, :admin_project, project)
= link_to integration.title, edit_project_service_path(project, integration) = link_to integration.title, edit_project_integration_path(project, integration)
- else - else
= integration.title = integration.title
%td %td
......
.js-jira-import-root{ data: { project_path: @project.full_path, .js-jira-import-root{ data: { project_path: @project.full_path,
issues_path: project_issues_path(@project), issues_path: project_issues_path(@project),
jira_integration_path: edit_project_service_path(@project, :jira), jira_integration_path: edit_project_integration_path(@project, :jira),
is_jira_configured: @project.jira_integration&.configured?.to_s, is_jira_configured: @project.jira_integration&.configured?.to_s,
in_progress_illustration: image_path('illustrations/export-import.svg'), in_progress_illustration: image_path('illustrations/export-import.svg'),
project_id: @project.id, project_id: @project.id,
......
...@@ -15,4 +15,4 @@ ...@@ -15,4 +15,4 @@
and try again. and try again.
%hr %hr
.clearfix .clearfix
= link_to 'Go back', edit_project_service_path(@project, @integration), class: 'gl-button btn btn-lg float-right' = link_to 'Go back', edit_project_integration_path(@project, @integration), class: 'gl-button btn btn-lg float-right'
...@@ -42,5 +42,5 @@ ...@@ -42,5 +42,5 @@
%hr %hr
.clearfix .clearfix
.float-right .float-right
= link_to _('Cancel'), edit_project_service_path(@project, @integration), class: 'gl-button btn btn-lg' = link_to _('Cancel'), edit_project_integration_path(@project, @integration), class: 'gl-button btn btn-lg'
= f.submit 'Install', class: 'gl-button btn btn-success btn-lg' = f.submit 'Install', class: 'gl-button btn btn-success btn-lg'
- add_to_breadcrumbs _("Settings"), edit_project_path(@project) - add_to_breadcrumbs _("Settings"), edit_project_path(@project)
- add_to_breadcrumbs _("Integrations"), project_settings_integrations_path(@project) - add_to_breadcrumbs _("Integrations"), project_settings_integrations_path(@project)
- add_to_breadcrumbs "Prometheus", edit_project_service_path(@project, ::Integrations::Prometheus) - add_to_breadcrumbs "Prometheus", edit_project_integration_path(@project, ::Integrations::Prometheus)
- breadcrumb_title s_('Metrics|Edit metric') - breadcrumb_title s_('Metrics|Edit metric')
- page_title @metric.title, s_('Metrics|Edit metric') - page_title @metric.title, s_('Metrics|Edit metric')
= render 'form', project: @project, metric: @metric = render 'form', project: @project, metric: @metric
- add_to_breadcrumbs _("Settings"), edit_project_path(@project) - add_to_breadcrumbs _("Settings"), edit_project_path(@project)
- add_to_breadcrumbs _("Integrations"), project_settings_integrations_path(@project) - add_to_breadcrumbs _("Integrations"), project_settings_integrations_path(@project)
- add_to_breadcrumbs "Prometheus", edit_project_service_path(@project, ::Integrations::Prometheus) - add_to_breadcrumbs "Prometheus", edit_project_integration_path(@project, ::Integrations::Prometheus)
- breadcrumb_title s_('Metrics|New metric') - breadcrumb_title s_('Metrics|New metric')
- page_title s_('Metrics|New metric') - page_title s_('Metrics|New metric')
= render 'form', project: @project, metric: @metric = render 'form', project: @project, metric: @metric
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
- if integration.operating? - if integration.operating?
= sprite_icon('check', css_class: 'gl-text-green-500') = sprite_icon('check', css_class: 'gl-text-green-500')
= form_for(integration, as: :service, url: scoped_integration_path(integration, project: @project, group: @group), method: :put, html: { class: 'gl-show-field-errors integration-settings-form js-integration-settings-form', data: { 'test-url' => test_project_service_path(@project, integration) } }) do |form| = form_for(integration, as: :service, url: scoped_integration_path(integration, project: @project, group: @group), method: :put, html: { class: 'gl-show-field-errors integration-settings-form js-integration-settings-form', data: { 'test-url' => test_project_integration_path(@project, integration) } }) do |form|
= render 'shared/service_settings', form: form, integration: integration = render 'shared/service_settings', form: form, integration: integration
%input{ id: 'services_redirect_to', type: 'hidden', name: 'redirect_to', value: request.referer } %input{ id: 'services_redirect_to', type: 'hidden', name: 'redirect_to', value: request.referer }
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
= create_link = create_link
- if show_enable_confluence_integration?(@wiki.container) - if show_enable_confluence_integration?(@wiki.container)
= link_to s_('WikiEmpty|Enable the Confluence Wiki integration'), = link_to s_('WikiEmpty|Enable the Confluence Wiki integration'),
edit_project_service_path(@project, :confluence), edit_project_integration_path(@project, :confluence),
class: 'btn gl-button', title: s_('WikiEmpty|Enable the Confluence Wiki integration') class: 'btn gl-button', title: s_('WikiEmpty|Enable the Confluence Wiki integration')
- elsif @project && can?(current_user, :read_issue, @project) - elsif @project && can?(current_user, :read_issue, @project)
......
...@@ -212,7 +212,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do ...@@ -212,7 +212,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end end
end end
resources :services, constraints: { id: %r{[^/]+} }, only: [:edit, :update] do resources :integrations, controller: :services, constraints: { id: %r{[^/]+} }, only: [:edit, :update] do
member do member do
put :test put :test
end end
......
...@@ -45,7 +45,7 @@ module Projects ...@@ -45,7 +45,7 @@ module Projects
private private
def redirect_to_service_page def redirect_to_service_page
redirect_to edit_project_service_path( redirect_to edit_project_integration_path(
project, project,
project.gitlab_slack_application_integration || project.build_gitlab_slack_application_integration project.gitlab_slack_application_integration || project.build_gitlab_slack_application_integration
) )
......
...@@ -15,7 +15,7 @@ module VulnerabilitiesHelper ...@@ -15,7 +15,7 @@ module VulnerabilitiesHelper
new_issue_url: new_issue_url_for(vulnerability), new_issue_url: new_issue_url_for(vulnerability),
create_jira_issue_url: create_jira_issue_url_for(vulnerability), create_jira_issue_url: create_jira_issue_url_for(vulnerability),
related_jira_issues_path: project_integrations_jira_issues_path(vulnerability.project, vulnerability_ids: [vulnerability.id]), related_jira_issues_path: project_integrations_jira_issues_path(vulnerability.project, vulnerability_ids: [vulnerability.id]),
jira_integration_settings_path: edit_project_service_path(vulnerability.project, ::Integrations::Jira), jira_integration_settings_path: edit_project_integration_path(vulnerability.project, ::Integrations::Jira),
has_mr: !!vulnerability.finding.merge_request_feedback.try(:merge_request_id), has_mr: !!vulnerability.finding.merge_request_feedback.try(:merge_request_id),
create_mr_url: create_vulnerability_feedback_merge_request_path(vulnerability.finding.project), create_mr_url: create_vulnerability_feedback_merge_request_path(vulnerability.finding.project),
discussions_url: discussions_project_security_vulnerability_path(vulnerability.project, vulnerability), discussions_url: discussions_project_security_vulnerability_path(vulnerability.project, vulnerability),
......
...@@ -17,4 +17,4 @@ ...@@ -17,4 +17,4 @@
.footer-block.row-content-block .footer-block.row-content-block
= form.submit _('Save changes'), class: "gl-button btn btn-confirm" = form.submit _('Save changes'), class: "gl-button btn btn-confirm"
&nbsp; &nbsp;
= link_to _('Cancel'), edit_project_service_path(@project, @service), class: 'btn gl-button btn-cancel' = link_to _('Cancel'), edit_project_integration_path(@project, @service), class: 'btn gl-button btn-cancel'
...@@ -13,7 +13,7 @@ RSpec.describe Projects::Settings::SlacksController do ...@@ -13,7 +13,7 @@ RSpec.describe Projects::Settings::SlacksController do
describe 'GET show' do describe 'GET show' do
def redirect_url(project) def redirect_url(project)
edit_project_service_path( edit_project_integration_path(
project, project,
project.build_gitlab_slack_application_integration project.build_gitlab_slack_application_integration
) )
......
...@@ -13,7 +13,7 @@ RSpec.describe 'User activates GitHub Service' do ...@@ -13,7 +13,7 @@ RSpec.describe 'User activates GitHub Service' do
end end
it 'renders 404 when trying to access service settings directly' do it 'renders 404 when trying to access service settings directly' do
visit edit_project_service_path(project, :github) visit edit_project_integration_path(project, :github)
expect(page).to have_gitlab_http_status(:not_found) expect(page).to have_gitlab_http_status(:not_found)
end end
......
...@@ -7,7 +7,7 @@ RSpec.describe 'Slack application' do ...@@ -7,7 +7,7 @@ RSpec.describe 'Slack application' do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:role) { :developer } let(:role) { :developer }
let(:integration) { create(:gitlab_slack_application_integration, project: project) } let(:integration) { create(:gitlab_slack_application_integration, project: project) }
let(:slack_application_form_path) { edit_project_service_path(project, integration) } let(:slack_application_form_path) { edit_project_integration_path(project, integration) }
before do before do
gitlab_sign_in(user) gitlab_sign_in(user)
......
...@@ -66,7 +66,7 @@ RSpec.describe VulnerabilitiesHelper do ...@@ -66,7 +66,7 @@ RSpec.describe VulnerabilitiesHelper do
new_issue_url: "/#{project.full_path}/-/issues/new?vulnerability_id=#{vulnerability.id}", new_issue_url: "/#{project.full_path}/-/issues/new?vulnerability_id=#{vulnerability.id}",
create_jira_issue_url: nil, create_jira_issue_url: nil,
related_jira_issues_path: "/#{project.full_path}/-/integrations/jira/issues?vulnerability_ids%5B%5D=#{vulnerability.id}", related_jira_issues_path: "/#{project.full_path}/-/integrations/jira/issues?vulnerability_ids%5B%5D=#{vulnerability.id}",
jira_integration_settings_path: "/#{project.full_path}/-/services/jira/edit", jira_integration_settings_path: "/#{project.full_path}/-/integrations/jira/edit",
has_mr: anything, has_mr: anything,
create_mr_url: "/#{project.full_path}/-/vulnerability_feedback", create_mr_url: "/#{project.full_path}/-/vulnerability_feedback",
discussions_url: "/#{project.full_path}/-/security/vulnerabilities/#{vulnerability.id}/discussions", discussions_url: "/#{project.full_path}/-/security/vulnerabilities/#{vulnerability.id}/discussions",
......
...@@ -60,9 +60,9 @@ RSpec.describe Projects::MattermostsController do ...@@ -60,9 +60,9 @@ RSpec.describe Projects::MattermostsController do
it 'redirects to the new page' do it 'redirects to the new page' do
subject subject
service = project.integrations.last integration = project.integrations.last
expect(subject).to redirect_to(edit_project_service_url(project, service)) expect(subject).to redirect_to(edit_project_integration_path(project, integration))
end end
end end
end end
......
...@@ -141,7 +141,7 @@ RSpec.describe Projects::Prometheus::MetricsController do ...@@ -141,7 +141,7 @@ RSpec.describe Projects::Prometheus::MetricsController do
expect(flash[:notice]).to include('Metric was successfully added.') expect(flash[:notice]).to include('Metric was successfully added.')
expect(response).to redirect_to(edit_project_service_path(project, ::Integrations::Prometheus)) expect(response).to redirect_to(edit_project_integration_path(project, ::Integrations::Prometheus))
end end
end end
...@@ -157,6 +157,22 @@ RSpec.describe Projects::Prometheus::MetricsController do ...@@ -157,6 +157,22 @@ RSpec.describe Projects::Prometheus::MetricsController do
end end
end end
describe 'PUT #update' do
context 'metric is updated' do
let_it_be(:metric) { create(:prometheus_metric, project: project) }
let(:metric_params) { { prometheus_metric: { title: 'new_title' }, id: metric.id } }
it 'shows a success flash message' do
put :update, params: project_params(metric_params)
expect(metric.reload.title).to eq('new_title')
expect(flash[:notice]).to include('Metric was successfully updated.')
expect(response).to redirect_to(edit_project_integration_path(project, ::Integrations::Prometheus))
end
end
end
describe 'DELETE #destroy' do describe 'DELETE #destroy' do
context 'format html' do context 'format html' do
let!(:metric) { create(:prometheus_metric, project: project) } let!(:metric) { create(:prometheus_metric, project: project) }
...@@ -164,7 +180,7 @@ RSpec.describe Projects::Prometheus::MetricsController do ...@@ -164,7 +180,7 @@ RSpec.describe Projects::Prometheus::MetricsController do
it 'destroys the metric' do it 'destroys the metric' do
delete :destroy, params: project_params(id: metric.id) delete :destroy, params: project_params(id: metric.id)
expect(response).to redirect_to(edit_project_service_path(project, ::Integrations::Prometheus)) expect(response).to redirect_to(edit_project_integration_path(project, ::Integrations::Prometheus))
expect(PrometheusMetric.find_by(id: metric.id)).to be_nil expect(PrometheusMetric.find_by(id: metric.id)).to be_nil
end end
end end
......
...@@ -11,7 +11,7 @@ RSpec.describe Projects::ServiceHookLogsController do ...@@ -11,7 +11,7 @@ RSpec.describe Projects::ServiceHookLogsController do
{ {
namespace_id: project.namespace, namespace_id: project.namespace,
project_id: project, project_id: project,
service_id: integration.to_param, integration_id: integration.to_param,
id: log.id id: log.id
} }
end end
...@@ -44,7 +44,7 @@ RSpec.describe Projects::ServiceHookLogsController do ...@@ -44,7 +44,7 @@ RSpec.describe Projects::ServiceHookLogsController do
it 'executes the hook and redirects to the service form' do it 'executes the hook and redirects to the service form' do
expect_any_instance_of(ServiceHook).to receive(:execute) expect_any_instance_of(ServiceHook).to receive(:execute)
expect_any_instance_of(described_class).to receive(:set_hook_execution_notice) expect_any_instance_of(described_class).to receive(:set_hook_execution_notice)
expect(subject).to redirect_to(edit_project_service_path(project, integration)) expect(subject).to redirect_to(edit_project_integration_path(project, integration))
end end
it 'renders a 404 if the hook does not exist' do it 'renders a 404 if the hook does not exist' do
......
...@@ -183,7 +183,7 @@ RSpec.describe Projects::ServicesController do ...@@ -183,7 +183,7 @@ RSpec.describe Projects::ServicesController do
let(:params) { project_params(service: integration_params) } let(:params) { project_params(service: integration_params) }
let(:message) { 'Jira settings saved and active.' } let(:message) { 'Jira settings saved and active.' }
let(:redirect_url) { edit_project_service_path(project, integration) } let(:redirect_url) { edit_project_integration_path(project, integration) }
before do before do
stub_jira_integration_test stub_jira_integration_test
...@@ -341,7 +341,7 @@ RSpec.describe Projects::ServicesController do ...@@ -341,7 +341,7 @@ RSpec.describe Projects::ServicesController do
it 'redirects user back to edit page with alert' do it 'redirects user back to edit page with alert' do
put :update, params: project_params.merge(service: integration_params) put :update, params: project_params.merge(service: integration_params)
expect(response).to redirect_to(edit_project_service_path(project, integration)) expect(response).to redirect_to(edit_project_integration_path(project, integration))
expected_alert = [ expected_alert = [
"You can now manage your Prometheus settings on the", "You can now manage your Prometheus settings on the",
%(<a href="#{project_settings_operations_path(project)}">Operations</a> page.), %(<a href="#{project_settings_operations_path(project)}">Operations</a> page.),
......
...@@ -20,7 +20,7 @@ RSpec.describe 'User activates Jira', :js do ...@@ -20,7 +20,7 @@ RSpec.describe 'User activates Jira', :js do
it 'activates the Jira service' do it 'activates the Jira service' do
expect(page).to have_content('Jira settings saved and active.') expect(page).to have_content('Jira settings saved and active.')
expect(current_path).to eq(edit_project_service_path(project, :jira)) expect(current_path).to eq(edit_project_integration_path(project, :jira))
end end
unless Gitlab.ee? unless Gitlab.ee?
...@@ -55,7 +55,7 @@ RSpec.describe 'User activates Jira', :js do ...@@ -55,7 +55,7 @@ RSpec.describe 'User activates Jira', :js do
click_test_then_save_integration click_test_then_save_integration
expect(page).to have_content('Jira settings saved and active.') expect(page).to have_content('Jira settings saved and active.')
expect(current_path).to eq(edit_project_service_path(project, :jira)) expect(current_path).to eq(edit_project_integration_path(project, :jira))
end end
end end
end end
...@@ -72,7 +72,7 @@ RSpec.describe 'User activates Jira', :js do ...@@ -72,7 +72,7 @@ RSpec.describe 'User activates Jira', :js do
it 'saves but does not activate the Jira service' do it 'saves but does not activate the Jira service' do
expect(page).to have_content('Jira settings saved, but not active.') expect(page).to have_content('Jira settings saved, but not active.')
expect(current_path).to eq(edit_project_service_path(project, :jira)) expect(current_path).to eq(edit_project_integration_path(project, :jira))
end end
it 'does not show the Jira link in the menu' do it 'does not show the Jira link in the menu' do
......
...@@ -34,7 +34,7 @@ RSpec.describe 'User activates issue tracker', :js do ...@@ -34,7 +34,7 @@ RSpec.describe 'User activates issue tracker', :js do
it 'activates the service' do it 'activates the service' do
expect(page).to have_content("#{tracker} settings saved and active.") expect(page).to have_content("#{tracker} settings saved and active.")
expect(current_path).to eq(edit_project_service_path(project, tracker.parameterize(separator: '_'))) expect(current_path).to eq(edit_project_integration_path(project, tracker.parameterize(separator: '_')))
end end
it 'shows the link in the menu' do it 'shows the link in the menu' do
...@@ -58,7 +58,7 @@ RSpec.describe 'User activates issue tracker', :js do ...@@ -58,7 +58,7 @@ RSpec.describe 'User activates issue tracker', :js do
end end
expect(page).to have_content("#{tracker} settings saved and active.") expect(page).to have_content("#{tracker} settings saved and active.")
expect(current_path).to eq(edit_project_service_path(project, tracker.parameterize(separator: '_'))) expect(current_path).to eq(edit_project_integration_path(project, tracker.parameterize(separator: '_')))
end end
end end
end end
...@@ -73,7 +73,7 @@ RSpec.describe 'User activates issue tracker', :js do ...@@ -73,7 +73,7 @@ RSpec.describe 'User activates issue tracker', :js do
it 'saves but does not activate the service' do it 'saves but does not activate the service' do
expect(page).to have_content("#{tracker} settings saved, but not active.") expect(page).to have_content("#{tracker} settings saved, but not active.")
expect(current_path).to eq(edit_project_service_path(project, tracker.parameterize(separator: '_'))) expect(current_path).to eq(edit_project_integration_path(project, tracker.parameterize(separator: '_')))
end end
it 'does not show the external tracker link in the menu' do it 'does not show the external tracker link in the menu' do
......
...@@ -15,7 +15,7 @@ RSpec.describe 'Set up Mattermost slash commands', :js do ...@@ -15,7 +15,7 @@ RSpec.describe 'Set up Mattermost slash commands', :js do
let(:mattermost_enabled) { true } let(:mattermost_enabled) { true }
describe 'activation' do describe 'activation' do
let(:edit_path) { edit_project_service_path(project, :mattermost_slash_commands) } let(:edit_path) { edit_project_integration_path(project, :mattermost_slash_commands) }
include_examples 'user activates the Mattermost Slash Command integration' include_examples 'user activates the Mattermost Slash Command integration'
end end
......
...@@ -34,7 +34,7 @@ RSpec.describe 'User activates Slack notifications', :js do ...@@ -34,7 +34,7 @@ RSpec.describe 'User activates Slack notifications', :js do
pipeline_channel: 6, pipeline_channel: 6,
wiki_page_channel: 7) wiki_page_channel: 7)
visit(edit_project_service_path(project, integration)) visit(edit_project_integration_path(project, integration))
end end
it 'filters events by channel' do it 'filters events by channel' do
......
...@@ -24,7 +24,7 @@ RSpec.describe 'Slack slash commands', :js do ...@@ -24,7 +24,7 @@ RSpec.describe 'Slack slash commands', :js do
click_active_checkbox click_active_checkbox
click_on 'Save' click_on 'Save'
expect(current_path).to eq(edit_project_service_path(project, :slack_slash_commands)) expect(current_path).to eq(edit_project_integration_path(project, :slack_slash_commands))
expect(page).to have_content('Slack slash commands settings saved, but not active.') expect(page).to have_content('Slack slash commands settings saved, but not active.')
end end
...@@ -32,7 +32,7 @@ RSpec.describe 'Slack slash commands', :js do ...@@ -32,7 +32,7 @@ RSpec.describe 'Slack slash commands', :js do
fill_in 'Token', with: 'token' fill_in 'Token', with: 'token'
click_on 'Save' click_on 'Save'
expect(current_path).to eq(edit_project_service_path(project, :slack_slash_commands)) expect(current_path).to eq(edit_project_integration_path(project, :slack_slash_commands))
expect(page).to have_content('Slack slash commands settings saved and active.') expect(page).to have_content('Slack slash commands settings saved and active.')
end end
......
...@@ -128,7 +128,7 @@ exports[`Dashboard template matches the default snapshot 1`] = ` ...@@ -128,7 +128,7 @@ exports[`Dashboard template matches the default snapshot 1`] = `
emptynodatasvgpath="/images/illustrations/monitoring/no_data.svg" emptynodatasvgpath="/images/illustrations/monitoring/no_data.svg"
emptyunabletoconnectsvgpath="/images/illustrations/monitoring/unable_to_connect.svg" emptyunabletoconnectsvgpath="/images/illustrations/monitoring/unable_to_connect.svg"
selectedstate="gettingStarted" selectedstate="gettingStarted"
settingspath="/monitoring/monitor-project/-/services/prometheus/edit" settingspath="/monitoring/monitor-project/-/integrations/prometheus/edit"
/> />
</div> </div>
`; `;
...@@ -18,7 +18,7 @@ RSpec.describe EnvironmentsHelper do ...@@ -18,7 +18,7 @@ RSpec.describe EnvironmentsHelper do
it 'returns data' do it 'returns data' do
expect(metrics_data).to include( expect(metrics_data).to include(
'settings_path' => edit_project_service_path(project, 'prometheus'), 'settings_path' => edit_project_integration_path(project, 'prometheus'),
'clusters_path' => project_clusters_path(project), 'clusters_path' => project_clusters_path(project),
'metrics_dashboard_base_path' => environment_metrics_path(environment), 'metrics_dashboard_base_path' => environment_metrics_path(environment),
'current_environment_name' => environment.name, 'current_environment_name' => environment.name,
......
...@@ -32,7 +32,7 @@ RSpec.describe OperationsHelper do ...@@ -32,7 +32,7 @@ RSpec.describe OperationsHelper do
expect(subject).to eq( expect(subject).to eq(
'alerts_setup_url' => help_page_path('operations/incident_management/integrations.md', anchor: 'configuration'), 'alerts_setup_url' => help_page_path('operations/incident_management/integrations.md', anchor: 'configuration'),
'alerts_usage_url' => project_alert_management_index_path(project), 'alerts_usage_url' => project_alert_management_index_path(project),
'prometheus_form_path' => project_service_path(project, prometheus_integration), 'prometheus_form_path' => project_integration_path(project, prometheus_integration),
'prometheus_reset_key_path' => reset_alerting_token_project_settings_operations_path(project), 'prometheus_reset_key_path' => reset_alerting_token_project_settings_operations_path(project),
'prometheus_authorization_key' => nil, 'prometheus_authorization_key' => nil,
'prometheus_api_url' => nil, 'prometheus_api_url' => nil,
......
...@@ -12,7 +12,7 @@ RSpec.describe ServiceHookPresenter do ...@@ -12,7 +12,7 @@ RSpec.describe ServiceHookPresenter do
subject { service_hook.present.logs_details_path(web_hook_log) } subject { service_hook.present.logs_details_path(web_hook_log) }
let(:expected_path) do let(:expected_path) do
"/#{project.namespace.path}/#{project.name}/-/services/#{integration.to_param}/hook_logs/#{web_hook_log.id}" "/#{project.namespace.path}/#{project.name}/-/integrations/#{integration.to_param}/hook_logs/#{web_hook_log.id}"
end end
it { is_expected.to eq(expected_path) } it { is_expected.to eq(expected_path) }
...@@ -22,7 +22,7 @@ RSpec.describe ServiceHookPresenter do ...@@ -22,7 +22,7 @@ RSpec.describe ServiceHookPresenter do
subject { service_hook.present.logs_retry_path(web_hook_log) } subject { service_hook.present.logs_retry_path(web_hook_log) }
let(:expected_path) do let(:expected_path) do
"/#{project.namespace.path}/#{project.name}/-/services/#{integration.to_param}/hook_logs/#{web_hook_log.id}/retry" "/#{project.namespace.path}/#{project.name}/-/integrations/#{integration.to_param}/hook_logs/#{web_hook_log.id}/retry"
end end
it { is_expected.to eq(expected_path) } it { is_expected.to eq(expected_path) }
......
...@@ -21,7 +21,7 @@ RSpec.describe WebHookLogPresenter do ...@@ -21,7 +21,7 @@ RSpec.describe WebHookLogPresenter do
let(:web_hook) { create(:service_hook, integration: integration) } let(:web_hook) { create(:service_hook, integration: integration) }
let(:integration) { create(:drone_ci_integration, project: project) } let(:integration) { create(:drone_ci_integration, project: project) }
it { is_expected.to eq(project_service_hook_log_path(project, integration, web_hook_log)) } it { is_expected.to eq(project_integration_hook_log_path(project, integration, web_hook_log)) }
end end
end end
...@@ -41,7 +41,7 @@ RSpec.describe WebHookLogPresenter do ...@@ -41,7 +41,7 @@ RSpec.describe WebHookLogPresenter do
let(:web_hook) { create(:service_hook, integration: integration) } let(:web_hook) { create(:service_hook, integration: integration) }
let(:integration) { create(:drone_ci_integration, project: project) } let(:integration) { create(:drone_ci_integration, project: project) }
it { is_expected.to eq(retry_project_service_hook_log_path(project, integration, web_hook_log)) } it { is_expected.to eq(retry_project_integration_hook_log_path(project, integration, web_hook_log)) }
end end
end 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