Commit 4c1368a9 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'controller-feature-categories-a' into 'master'

Controller feature categories: A [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!44283
parents 8054d618 fbb0b9ba
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
class AbuseReportsController < ApplicationController class AbuseReportsController < ApplicationController
before_action :set_user, only: [:new] before_action :set_user, only: [:new]
feature_category :users
def new def new
@abuse_report = AbuseReport.new @abuse_report = AbuseReport.new
@abuse_report.user_id = @user.id @abuse_report.user_id = @user.id
......
# frozen_string_literal: true # frozen_string_literal: true
class Admin::AbuseReportsController < Admin::ApplicationController class Admin::AbuseReportsController < Admin::ApplicationController
feature_category :users
def index def index
@abuse_reports = AbuseReportsFinder.new(params).execute @abuse_reports = AbuseReportsFinder.new(params).execute
end end
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
class Admin::AppearancesController < Admin::ApplicationController class Admin::AppearancesController < Admin::ApplicationController
before_action :set_appearance, except: :create before_action :set_appearance, except: :create
feature_category :navigation
def show def show
end end
......
...@@ -17,6 +17,24 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController ...@@ -17,6 +17,24 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
push_frontend_feature_flag(:ci_instance_variables_ui, default_enabled: true) push_frontend_feature_flag(:ci_instance_variables_ui, default_enabled: true)
end end
feature_category :not_owned, [
:general, :reporting, :metrics_and_profiling, :network,
:preferences, :update, :reset_health_check_token
]
feature_category :metrics, [
:create_self_monitoring_project,
:status_create_self_monitoring_project,
:delete_self_monitoring_project,
:status_delete_self_monitoring_project
]
feature_category :source_code_management, [:repository, :clear_repository_check_states]
feature_category :continuous_integration, [:ci_cd, :reset_registration_token]
feature_category :collection, [:usage_data]
feature_category :integrations, [:integrations]
feature_category :pages, [:lets_encrypt_terms_of_service]
VALID_SETTING_PANELS = %w(general repository VALID_SETTING_PANELS = %w(general repository
ci_cd reporting metrics_and_profiling ci_cd reporting metrics_and_profiling
network preferences).freeze network preferences).freeze
......
...@@ -6,6 +6,8 @@ class Admin::ApplicationsController < Admin::ApplicationController ...@@ -6,6 +6,8 @@ class Admin::ApplicationsController < Admin::ApplicationController
before_action :set_application, only: [:show, :edit, :update, :destroy] before_action :set_application, only: [:show, :edit, :update, :destroy]
before_action :load_scopes, only: [:new, :create, :edit, :update] before_action :load_scopes, only: [:new, :create, :edit, :update]
feature_category :authentication_and_authorization
def index def index
applications = ApplicationsFinder.new.execute applications = ApplicationsFinder.new.execute
@applications = Kaminari.paginate_array(applications).page(params[:page]) @applications = Kaminari.paginate_array(applications).page(params[:page])
......
# frozen_string_literal: true # frozen_string_literal: true
class Admin::BackgroundJobsController < Admin::ApplicationController class Admin::BackgroundJobsController < Admin::ApplicationController
feature_category :not_owned
end end
...@@ -5,6 +5,8 @@ class Admin::BroadcastMessagesController < Admin::ApplicationController ...@@ -5,6 +5,8 @@ class Admin::BroadcastMessagesController < Admin::ApplicationController
before_action :finder, only: [:edit, :update, :destroy] before_action :finder, only: [:edit, :update, :destroy]
feature_category :navigation
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def index def index
@broadcast_messages = BroadcastMessage.order(ends_at: :desc).page(params[:page]) @broadcast_messages = BroadcastMessage.order(ends_at: :desc).page(params[:page])
......
# frozen_string_literal: true # frozen_string_literal: true
class Admin::Ci::VariablesController < Admin::ApplicationController class Admin::Ci::VariablesController < Admin::ApplicationController
feature_category :continuous_integration
def show def show
respond_to do |format| respond_to do |format|
format.json { render_instance_variables } format.json { render_instance_variables }
......
...@@ -5,6 +5,8 @@ class Admin::CohortsController < Admin::ApplicationController ...@@ -5,6 +5,8 @@ class Admin::CohortsController < Admin::ApplicationController
track_unique_visits :index, target_id: 'i_analytics_cohorts' track_unique_visits :index, target_id: 'i_analytics_cohorts'
feature_category :instance_statistics
def index def index
if Gitlab::CurrentSettings.usage_ping_enabled if Gitlab::CurrentSettings.usage_ping_enabled
cohorts_results = Rails.cache.fetch('cohorts', expires_in: 1.day) do cohorts_results = Rails.cache.fetch('cohorts', expires_in: 1.day) do
......
...@@ -6,6 +6,8 @@ class Admin::DashboardController < Admin::ApplicationController ...@@ -6,6 +6,8 @@ class Admin::DashboardController < Admin::ApplicationController
COUNTED_ITEMS = [Project, User, Group].freeze COUNTED_ITEMS = [Project, User, Group].freeze
feature_category :not_owned
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def index def index
@counts = Gitlab::Database::Count.approximate_counts(COUNTED_ITEMS) @counts = Gitlab::Database::Count.approximate_counts(COUNTED_ITEMS)
......
...@@ -4,6 +4,8 @@ class Admin::DeployKeysController < Admin::ApplicationController ...@@ -4,6 +4,8 @@ class Admin::DeployKeysController < Admin::ApplicationController
before_action :deploy_keys, only: [:index] before_action :deploy_keys, only: [:index]
before_action :deploy_key, only: [:destroy, :edit, :update] before_action :deploy_key, only: [:destroy, :edit, :update]
feature_category :continuous_delivery
def index def index
end end
......
...@@ -5,6 +5,8 @@ class Admin::DevOpsReportController < Admin::ApplicationController ...@@ -5,6 +5,8 @@ class Admin::DevOpsReportController < Admin::ApplicationController
track_unique_visits :show, target_id: 'i_analytics_dev_ops_score' track_unique_visits :show, target_id: 'i_analytics_dev_ops_score'
feature_category :devops_reports
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def show def show
@metric = DevOpsReport::Metric.order(:created_at).last&.present @metric = DevOpsReport::Metric.order(:created_at).last&.present
......
# frozen_string_literal: true # frozen_string_literal: true
class Admin::GitalyServersController < Admin::ApplicationController class Admin::GitalyServersController < Admin::ApplicationController
feature_category :gitaly
def index def index
@gitaly_servers = Gitaly::Server.all @gitaly_servers = Gitaly::Server.all
end end
......
...@@ -5,6 +5,8 @@ class Admin::GroupsController < Admin::ApplicationController ...@@ -5,6 +5,8 @@ class Admin::GroupsController < Admin::ApplicationController
before_action :group, only: [:edit, :update, :destroy, :project_update, :members_update] before_action :group, only: [:edit, :update, :destroy, :project_update, :members_update]
feature_category :subgroups
def index def index
@groups = groups.sort_by_attribute(@sort = params[:sort]) @groups = groups.sort_by_attribute(@sort = params[:sort])
@groups = @groups.search(params[:name]) if params[:name].present? @groups = @groups.search(params[:name]) if params[:name].present?
......
# frozen_string_literal: true # frozen_string_literal: true
class Admin::HealthCheckController < Admin::ApplicationController class Admin::HealthCheckController < Admin::ApplicationController
feature_category :not_owned
def show def show
@errors = HealthCheck::Utils.process_checks(checks) @errors = HealthCheck::Utils.process_checks(checks)
end end
......
...@@ -8,6 +8,8 @@ class Admin::HookLogsController < Admin::ApplicationController ...@@ -8,6 +8,8 @@ class Admin::HookLogsController < Admin::ApplicationController
respond_to :html respond_to :html
feature_category :integrations
def show def show
end end
......
...@@ -5,6 +5,8 @@ class Admin::HooksController < Admin::ApplicationController ...@@ -5,6 +5,8 @@ class Admin::HooksController < Admin::ApplicationController
before_action :hook_logs, only: :edit before_action :hook_logs, only: :edit
feature_category :integrations
def index def index
@hooks = SystemHook.all @hooks = SystemHook.all
@hook = SystemHook.new @hook = SystemHook.new
......
...@@ -4,6 +4,8 @@ class Admin::IdentitiesController < Admin::ApplicationController ...@@ -4,6 +4,8 @@ class Admin::IdentitiesController < Admin::ApplicationController
before_action :user before_action :user
before_action :identity, except: [:index, :new, :create] before_action :identity, except: [:index, :new, :create]
feature_category :authentication_and_authorization
def new def new
@identity = Identity.new @identity = Identity.new
end end
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
class Admin::ImpersonationTokensController < Admin::ApplicationController class Admin::ImpersonationTokensController < Admin::ApplicationController
before_action :user before_action :user
feature_category :authentication_and_authorization
def index def index
set_index_vars set_index_vars
end end
......
...@@ -4,6 +4,8 @@ class Admin::ImpersonationsController < Admin::ApplicationController ...@@ -4,6 +4,8 @@ class Admin::ImpersonationsController < Admin::ApplicationController
skip_before_action :authenticate_admin! skip_before_action :authenticate_admin!
before_action :authenticate_impersonator! before_action :authenticate_impersonator!
feature_category :authentication_and_authorization
def destroy def destroy
original_user = stop_impersonation original_user = stop_impersonation
redirect_to admin_user_path(original_user), status: :found redirect_to admin_user_path(original_user), status: :found
......
...@@ -7,6 +7,8 @@ class Admin::InstanceStatisticsController < Admin::ApplicationController ...@@ -7,6 +7,8 @@ class Admin::InstanceStatisticsController < Admin::ApplicationController
track_unique_visits :index, target_id: 'i_analytics_instance_statistics' track_unique_visits :index, target_id: 'i_analytics_instance_statistics'
feature_category :instance_statistics
def index def index
end end
......
...@@ -4,6 +4,8 @@ class Admin::IntegrationsController < Admin::ApplicationController ...@@ -4,6 +4,8 @@ class Admin::IntegrationsController < Admin::ApplicationController
include IntegrationsActions include IntegrationsActions
include ServicesHelper include ServicesHelper
feature_category :integrations
private private
def find_or_initialize_integration(name) def find_or_initialize_integration(name)
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
class Admin::JobsController < Admin::ApplicationController class Admin::JobsController < Admin::ApplicationController
BUILDS_PER_PAGE = 30 BUILDS_PER_PAGE = 30
feature_category :continuous_integration
def index def index
# We need all builds for tabs counters # We need all builds for tabs counters
@all_builds = Ci::JobsFinder.new(current_user: current_user).execute @all_builds = Ci::JobsFinder.new(current_user: current_user).execute
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
class Admin::KeysController < Admin::ApplicationController class Admin::KeysController < Admin::ApplicationController
before_action :user, only: [:show, :destroy] before_action :user, only: [:show, :destroy]
feature_category :authentication_and_authorization
def show def show
@key = user.keys.find(params[:id]) @key = user.keys.find(params[:id])
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
class Admin::LabelsController < Admin::ApplicationController class Admin::LabelsController < Admin::ApplicationController
before_action :set_label, only: [:show, :edit, :update, :destroy] before_action :set_label, only: [:show, :edit, :update, :destroy]
feature_category :issue_tracking
def index def index
@labels = Label.templates.page(params[:page]) @labels = Label.templates.page(params[:page])
end end
......
...@@ -5,6 +5,8 @@ class Admin::PlanLimitsController < Admin::ApplicationController ...@@ -5,6 +5,8 @@ class Admin::PlanLimitsController < Admin::ApplicationController
before_action :set_plan_limits before_action :set_plan_limits
feature_category :not_owned
def create def create
redirect_path = referer_path(request) || general_admin_application_settings_path redirect_path = referer_path(request) || general_admin_application_settings_path
......
...@@ -6,6 +6,9 @@ class Admin::ProjectsController < Admin::ApplicationController ...@@ -6,6 +6,9 @@ class Admin::ProjectsController < Admin::ApplicationController
before_action :project, only: [:show, :transfer, :repository_check, :destroy] before_action :project, only: [:show, :transfer, :repository_check, :destroy]
before_action :group, only: [:show, :transfer] before_action :group, only: [:show, :transfer]
feature_category :projects, [:index, :show, :transfer, :destroy]
feature_category :source_code_management, [:repository_check]
def index def index
params[:sort] ||= 'latest_activity_desc' params[:sort] ||= 'latest_activity_desc'
@sort = params[:sort] @sort = params[:sort]
......
# frozen_string_literal: true # frozen_string_literal: true
class Admin::RequestsProfilesController < Admin::ApplicationController class Admin::RequestsProfilesController < Admin::ApplicationController
feature_category :not_owned
def index def index
@profile_token = Gitlab::RequestProfiler.profile_token @profile_token = Gitlab::RequestProfiler.profile_token
@profiles = Gitlab::RequestProfiler.all.group_by(&:request_path) @profiles = Gitlab::RequestProfiler.all.group_by(&:request_path)
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
class Admin::RunnerProjectsController < Admin::ApplicationController class Admin::RunnerProjectsController < Admin::ApplicationController
before_action :project, only: [:create] before_action :project, only: [:create]
feature_category :continuous_integration
def create def create
@runner = Ci::Runner.find(params[:runner_project][:runner_id]) @runner = Ci::Runner.find(params[:runner_project][:runner_id])
......
...@@ -5,6 +5,8 @@ class Admin::RunnersController < Admin::ApplicationController ...@@ -5,6 +5,8 @@ class Admin::RunnersController < Admin::ApplicationController
before_action :runner, except: [:index, :tag_list, :runner_setup_scripts] before_action :runner, except: [:index, :tag_list, :runner_setup_scripts]
feature_category :continuous_integration
def index def index
finder = Ci::RunnersFinder.new(current_user: current_user, params: params) finder = Ci::RunnersFinder.new(current_user: current_user, params: params)
@runners = finder.execute @runners = finder.execute
......
...@@ -4,6 +4,8 @@ class Admin::Serverless::DomainsController < Admin::ApplicationController ...@@ -4,6 +4,8 @@ class Admin::Serverless::DomainsController < Admin::ApplicationController
before_action :check_feature_flag before_action :check_feature_flag
before_action :domain, only: [:update, :verify, :destroy] before_action :domain, only: [:update, :verify, :destroy]
feature_category :serverless
def index def index
@domain = PagesDomain.instance_serverless.first_or_initialize @domain = PagesDomain.instance_serverless.first_or_initialize
end end
......
...@@ -6,6 +6,8 @@ class Admin::ServicesController < Admin::ApplicationController ...@@ -6,6 +6,8 @@ class Admin::ServicesController < Admin::ApplicationController
before_action :service, only: [:edit, :update] before_action :service, only: [:edit, :update]
before_action :whitelist_query_limiting, only: [:index] before_action :whitelist_query_limiting, only: [:index]
feature_category :integrations
def index def index
@services = Service.find_or_create_templates.sort_by(&:title) @services = Service.find_or_create_templates.sort_by(&:title)
@existing_instance_types = Service.for_instance.pluck(:type) # rubocop: disable CodeReuse/ActiveRecord @existing_instance_types = Service.for_instance.pluck(:type) # rubocop: disable CodeReuse/ActiveRecord
......
...@@ -7,6 +7,8 @@ class Admin::SessionsController < ApplicationController ...@@ -7,6 +7,8 @@ class Admin::SessionsController < ApplicationController
before_action :user_is_admin! before_action :user_is_admin!
feature_category :authentication_and_authorization
def new def new
if current_user_mode.admin_mode? if current_user_mode.admin_mode?
redirect_to redirect_path, notice: _('Admin mode already enabled') redirect_to redirect_path, notice: _('Admin mode already enabled')
......
# frozen_string_literal: true # frozen_string_literal: true
class Admin::SpamLogsController < Admin::ApplicationController class Admin::SpamLogsController < Admin::ApplicationController
feature_category :not_owned
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
def index def index
@spam_logs = SpamLog.order(id: :desc).page(params[:page]) @spam_logs = SpamLog.order(id: :desc).page(params[:page])
......
# frozen_string_literal: true # frozen_string_literal: true
class Admin::SystemInfoController < Admin::ApplicationController class Admin::SystemInfoController < Admin::ApplicationController
feature_category :not_owned
EXCLUDED_MOUNT_OPTIONS = %w[ EXCLUDED_MOUNT_OPTIONS = %w[
nobrowse nobrowse
read-only read-only
......
...@@ -7,6 +7,8 @@ class Admin::UsersController < Admin::ApplicationController ...@@ -7,6 +7,8 @@ class Admin::UsersController < Admin::ApplicationController
before_action :check_impersonation_availability, only: :impersonate before_action :check_impersonation_availability, only: :impersonate
before_action :ensure_destroy_prerequisites_met, only: [:destroy] before_action :ensure_destroy_prerequisites_met, only: [:destroy]
feature_category :users
def index def index
@users = User.filter_items(params[:filter]).order_name_asc @users = User.filter_items(params[:filter]).order_name_asc
@users = @users.search_with_secondary_emails(params[:search_query]) if params[:search_query].present? @users = @users.search_with_secondary_emails(params[:search_query]) if params[:search_query].present?
......
...@@ -3,6 +3,12 @@ ...@@ -3,6 +3,12 @@
class AutocompleteController < ApplicationController class AutocompleteController < ApplicationController
skip_before_action :authenticate_user!, only: [:users, :award_emojis, :merge_request_target_branches] skip_before_action :authenticate_user!, only: [:users, :award_emojis, :merge_request_target_branches]
feature_category :users, [:users, :user]
feature_category :projects, [:projects]
feature_category :issue_tracking, [:award_emojis]
feature_category :code_review, [:merge_request_target_branches]
feature_category :continuous_delivery, [:deploy_keys_with_owners]
def users def users
group = Autocomplete::GroupFinder group = Autocomplete::GroupFinder
.new(current_user, project, params) .new(current_user, project, params)
......
...@@ -8,6 +8,8 @@ class Clusters::BaseController < ApplicationController ...@@ -8,6 +8,8 @@ class Clusters::BaseController < ApplicationController
helper_method :clusterable helper_method :clusterable
feature_category :kubernetes_management
private private
def cluster def cluster
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
class Admin::AuditLogReportsController < Admin::ApplicationController class Admin::AuditLogReportsController < Admin::ApplicationController
before_action :validate_audit_log_reports_available! before_action :validate_audit_log_reports_available!
feature_category :audit_events
def index def index
csv_data = AuditEvents::ExportCsvService.new(audit_log_reports_params).csv_data csv_data = AuditEvents::ExportCsvService.new(audit_log_reports_params).csv_data
......
...@@ -12,6 +12,8 @@ class Admin::AuditLogsController < Admin::ApplicationController ...@@ -12,6 +12,8 @@ class Admin::AuditLogsController < Admin::ApplicationController
track_unique_visits :index, target_id: 'i_compliance_audit_events' track_unique_visits :index, target_id: 'i_compliance_audit_events'
feature_category :audit_events
PER_PAGE = 25 PER_PAGE = 25
def index def index
......
...@@ -11,6 +11,8 @@ class Admin::CredentialsController < Admin::ApplicationController ...@@ -11,6 +11,8 @@ class Admin::CredentialsController < Admin::ApplicationController
track_unique_visits :index, target_id: 'i_compliance_credential_inventory' track_unique_visits :index, target_id: 'i_compliance_credential_inventory'
feature_category :compliance_management
private private
def check_license_credentials_inventory_available! def check_license_credentials_inventory_available!
......
# frozen_string_literal: true # frozen_string_literal: true
class Admin::ElasticsearchController < Admin::ApplicationController class Admin::ElasticsearchController < Admin::ApplicationController
feature_category :global_search
# POST # POST
# Scheduling indexing jobs # Scheduling indexing jobs
def enqueue_index def enqueue_index
......
...@@ -6,6 +6,8 @@ class Admin::EmailsController < Admin::ApplicationController ...@@ -6,6 +6,8 @@ class Admin::EmailsController < Admin::ApplicationController
before_action :check_license_send_emails_from_admin_area_available! before_action :check_license_send_emails_from_admin_area_available!
before_action :check_rate_limit!, only: [:create] before_action :check_rate_limit!, only: [:create]
feature_category :not_owned
def show def show
end end
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
class Admin::Geo::ApplicationController < Admin::ApplicationController class Admin::Geo::ApplicationController < Admin::ApplicationController
helper ::EE::GeoHelper helper ::EE::GeoHelper
feature_category :geo_replication
protected protected
def check_license! def check_license!
......
...@@ -4,6 +4,8 @@ class Admin::Geo::SettingsController < Admin::ApplicationSettingsController ...@@ -4,6 +4,8 @@ class Admin::Geo::SettingsController < Admin::ApplicationSettingsController
helper ::EE::GeoHelper helper ::EE::GeoHelper
before_action :check_license!, except: :show before_action :check_license!, except: :show
feature_category :geo_replication
def show def show
end end
......
# frozen_string_literal: true # frozen_string_literal: true
class Admin::InstanceReviewController < Admin::ApplicationController class Admin::InstanceReviewController < Admin::ApplicationController
feature_category :instance_statistics
def index def index
redirect_to("#{EE::SUBSCRIPTIONS_URL}/instance_review?#{instance_review_params}") redirect_to("#{EE::SUBSCRIPTIONS_URL}/instance_review?#{instance_review_params}")
end end
......
...@@ -7,6 +7,8 @@ module Admin ...@@ -7,6 +7,8 @@ module Admin
before_action :require_license, only: :show before_action :require_license, only: :show
feature_category :collection
def show def show
historical_data = HistoricalData.in_license_term(license) historical_data = HistoricalData.in_license_term(license)
......
...@@ -8,6 +8,8 @@ class Admin::LicensesController < Admin::ApplicationController ...@@ -8,6 +8,8 @@ class Admin::LicensesController < Admin::ApplicationController
respond_to :html respond_to :html
feature_category :provision
def show def show
if @license.present? || License.future_dated_only? if @license.present? || License.future_dated_only?
@licenses = License.history @licenses = License.history
......
...@@ -7,6 +7,8 @@ class Admin::PushRulesController < Admin::ApplicationController ...@@ -7,6 +7,8 @@ class Admin::PushRulesController < Admin::ApplicationController
respond_to :html respond_to :html
feature_category :source_code_management
def show def show
end end
......
...@@ -11,6 +11,9 @@ module EE ...@@ -11,6 +11,9 @@ module EE
prepended do prepended do
before_action :elasticsearch_reindexing_task, only: [:general] before_action :elasticsearch_reindexing_task, only: [:general]
feature_category :provision, [:seat_link_payload]
feature_category :source_code_management, [:templates]
def elasticsearch_reindexing_task def elasticsearch_reindexing_task
@elasticsearch_reindexing_task = Elastic::ReindexingTask.last @elasticsearch_reindexing_task = Elastic::ReindexingTask.last
end end
......
...@@ -2,6 +2,13 @@ ...@@ -2,6 +2,13 @@
module EE module EE
module AutocompleteController module AutocompleteController
extend ::ActiveSupport::Concern
prepended do
feature_category :subgroups, [:project_groups, :namespace_routes]
feature_category :projects, [:project_routes]
end
def project_groups def project_groups
groups = ::Autocomplete::ProjectInvitedGroupsFinder groups = ::Autocomplete::ProjectInvitedGroupsFinder
.new(current_user, params) .new(current_user, params)
......
...@@ -18,7 +18,7 @@ RSpec.describe "Every controller" do ...@@ -18,7 +18,7 @@ RSpec.describe "Every controller" do
.select { |route| route[:controller].present? && route[:action].present? } .select { |route| route[:controller].present? && route[:action].present? }
.map { |route| [constantize_controller(route[:controller]), route[:action]] } .map { |route| [constantize_controller(route[:controller]), route[:action]] }
.select { |(controller, action)| controller&.include?(ControllerWithFeatureCategory) } .select { |(controller, action)| controller&.include?(ControllerWithFeatureCategory) }
.reject { |(controller, action)| controller == Devise::UnlocksController } .reject { |(controller, action)| controller == ApplicationController || controller == Devise::UnlocksController }
end end
let_it_be(:routes_without_category) do let_it_be(:routes_without_category) do
...@@ -29,7 +29,7 @@ RSpec.describe "Every controller" do ...@@ -29,7 +29,7 @@ RSpec.describe "Every controller" do
'H', 'I', 'J', 'K', 'L', 'H', 'I', 'J', 'K', 'L',
'M', 'N', 'O', 'Q', 'R', 'M', 'N', 'O', 'Q', 'R',
'S', 'T', 'U', 'V', 'W', 'S', 'T', 'U', 'V', 'W',
'X', 'Y', 'Z', 'X', 'Y', 'Z', 'A',
'Projects::MergeRequestsController') 'Projects::MergeRequestsController')
"#{controller}##{action}" "#{controller}##{action}"
......
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