Commit c549cdde authored by Stan Hu's avatar Stan Hu

Merge branch '330670-namespace-integrations-controller-concerns' into 'master'

Namespace integrations controller concerns

See merge request gitlab-org/gitlab!73430
parents aae11d62 79740505
# frozen_string_literal: true
class Admin::HookLogsController < Admin::ApplicationController
include HooksExecution
include ::Integrations::HooksExecution
before_action :hook, only: [:show, :retry]
before_action :hook_log, only: [:show, :retry]
......
# frozen_string_literal: true
class Admin::HooksController < Admin::ApplicationController
include HooksExecution
include ::Integrations::HooksExecution
before_action :hook_logs, only: :edit
......
# frozen_string_literal: true
class Admin::IntegrationsController < Admin::ApplicationController
include IntegrationsActions
include ::Integrations::Actions
before_action :not_found, unless: -> { instance_level_integrations? }
......
# frozen_string_literal: true
module IntegrationsActions
module Integrations::Actions
extend ActiveSupport::Concern
included do
......
# frozen_string_literal: true
module HooksExecution
module Integrations::HooksExecution
extend ActiveSupport::Concern
private
......
......@@ -3,7 +3,7 @@
module Groups
module Settings
class IntegrationsController < Groups::ApplicationController
include IntegrationsActions
include ::Integrations::Actions
before_action :authorize_admin_group!
......
# frozen_string_literal: true
class Projects::HookLogsController < Projects::ApplicationController
include HooksExecution
include ::Integrations::HooksExecution
before_action :authorize_admin_project!
......
# frozen_string_literal: true
class Projects::HooksController < Projects::ApplicationController
include HooksExecution
include ::Integrations::HooksExecution
# Authorize
before_action :authorize_admin_project!
......
# frozen_string_literal: true
class Groups::HooksController < Groups::ApplicationController
include HooksExecution
include ::Integrations::HooksExecution
# Authorize
before_action :group
......
......@@ -9,7 +9,7 @@ RSpec.describe Admin::IntegrationsController do
sign_in(admin)
end
it_behaves_like IntegrationsActions do
it_behaves_like Integrations::Actions do
let(:integration_attributes) { { instance: true, project: nil } }
let(:routing_params) do
......
......@@ -10,7 +10,7 @@ RSpec.describe Groups::Settings::IntegrationsController do
sign_in(user)
end
it_behaves_like IntegrationsActions do
it_behaves_like Integrations::Actions do
let(:integration_attributes) { { group: group, project: nil } }
let(:routing_params) do
......
......@@ -18,7 +18,7 @@ RSpec.describe Projects::ServicesController do
project.add_maintainer(user)
end
it_behaves_like IntegrationsActions do
it_behaves_like Integrations::Actions do
let(:integration_attributes) { { project: project } }
let(:routing_params) do
......
# frozen_string_literal: true
RSpec.shared_examples IntegrationsActions do
RSpec.shared_examples Integrations::Actions do
let(:integration) do
create(:datadog_integration,
integration_attributes.merge(
......
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