From 11c023e9beb8ff7f21c1da1f2f16fd4e1a2ecd6d Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Wed, 2 Jun 2021 17:16:04 +0200 Subject: [PATCH] Maintenance: Loosen RSpec/NestedGroups to find balance between readable code and current state of the codebase. --- .rubocop/default.yml | 3 ++ .rubocop/todo.rspec.yml | 76 -------------------------------- spec/requests/robots_txt_spec.rb | 4 +- 3 files changed, 5 insertions(+), 78 deletions(-) diff --git a/.rubocop/default.yml b/.rubocop/default.yml index 79198d53a..485cc880d 100644 --- a/.rubocop/default.yml +++ b/.rubocop/default.yml @@ -326,6 +326,9 @@ Layout/MultilineMethodCallIndentation: Lint/UnusedMethodArgument: AllowUnusedKeywordArguments: true +RSpec/NestedGroups: + Max: 6 + Zammad/PreferNegatedIfOverUnless: Exclude: - 'bin/rspec' diff --git a/.rubocop/todo.rspec.yml b/.rubocop/todo.rspec.yml index 02783ea9e..0510128b9 100644 --- a/.rubocop/todo.rspec.yml +++ b/.rubocop/todo.rspec.yml @@ -610,91 +610,15 @@ RSpec/NamedSubject: RSpec/NestedGroups: Exclude: - - 'spec/db/migrate/issue_2541_fix_notification_email_without_body_spec.rb' - - 'spec/jobs/communicate_twitter_job_spec.rb' - - 'spec/jobs/concerns/has_collection_update_spec.rb' - - 'spec/jobs/concerns/has_ticket_create_screen_impact_spec.rb' - - 'spec/lib/application_handle_info_spec.rb' - - 'spec/lib/core_ext/string_spec.rb' - - 'spec/lib/email_address_validation_spec.rb' - - 'spec/lib/external_credential/google_spec.rb' - - 'spec/lib/external_credential/microsoft365_spec.rb' - - 'spec/lib/html_sanitizer_spec.rb' - - 'spec/lib/import/exchange/folder_spec.rb' - - 'spec/lib/notification_factory/mailer_spec.rb' - - 'spec/lib/notification_factory/template_spec.rb' - - 'spec/lib/notification_factory_spec.rb' - - 'spec/lib/search_index_backend_spec.rb' - - 'spec/lib/search_knowledge_base_backend_spec.rb' - 'spec/lib/secure_mailing/smime_spec.rb' - - 'spec/lib/sessions/backend/base_spec.rb' - - 'spec/lib/sessions/backend/ticket_overview_list_spec.rb' - - 'spec/lib/signature_detection_spec.rb' - - 'spec/lib/stats/ticket_waiting_time_spec.rb' - - 'spec/lib/twitter_sync_spec.rb' - - 'spec/models/application_model/can_lookup_examples.rb' - - 'spec/models/calendar_spec.rb' - 'spec/models/channel/driver/twitter_spec.rb' - 'spec/models/channel/email_parser_spec.rb' - - 'spec/models/channel/filter/match/email_regex_spec.rb' - - 'spec/models/channel/filter/out_of_office_check_spec.rb' - - 'spec/models/concerns/has_collection_update_examples.rb' - - 'spec/models/concerns/has_groups_examples.rb' - - 'spec/models/concerns/has_history_examples.rb' - - 'spec/models/concerns/has_roles_examples.rb' - - 'spec/models/concerns/has_ticket_create_screen_impact_examples.rb' - - 'spec/models/cti/caller_id_spec.rb' - - 'spec/models/cti/log_spec.rb' - - 'spec/models/email_address_spec.rb' - - 'spec/models/history_spec.rb' - 'spec/models/job_spec.rb' - - 'spec/models/knowledge_base_spec.rb' - - 'spec/models/locale_spec.rb' - - 'spec/models/object_lookup_spec.rb' - - 'spec/models/object_manager/attribute/validation/min_max_spec.rb' - - 'spec/models/object_manager/attribute/validation/required_spec.rb' - - 'spec/models/object_manager/attribute/validation_spec.rb' - - 'spec/models/object_manager/attribute_spec.rb' - - 'spec/models/organization_spec.rb' - - 'spec/models/recent_view_spec.rb' - - 'spec/models/role_spec.rb' - - 'spec/models/scheduler_spec.rb' - - 'spec/models/smime_certificate_spec.rb' - - 'spec/models/tag/item_spec.rb' - - 'spec/models/tag_spec.rb' - - 'spec/models/taskbar_spec.rb' - - 'spec/models/ticket/article_spec.rb' - - 'spec/models/ticket/number/date_spec.rb' - - 'spec/models/ticket/number/increment_spec.rb' - - 'spec/models/ticket/state_spec.rb' - - 'spec/models/ticket/time_accounting_spec.rb' - - 'spec/models/ticket_spec.rb' - 'spec/models/token_spec.rb' - 'spec/models/trigger_spec.rb' - - 'spec/models/type_lookup_spec.rb' - 'spec/models/user/has_ticket_create_screen_impact_examples.rb' - - 'spec/models/user_device_spec.rb' - 'spec/models/user_spec.rb' - - 'spec/policies/ticket_policy_spec.rb' - - 'spec/policies/user_policy_spec.rb' - - 'spec/requests/channels_twitter_spec.rb' - - 'spec/requests/error_spec.rb' - - 'spec/requests/external_credentials_spec.rb' - - 'spec/requests/integration/object_manager_attributes_spec.rb' - - 'spec/requests/integration/smime_spec.rb' - - 'spec/requests/integration/telegram_spec.rb' - - 'spec/requests/knowledge_base/attachments_spec.rb' - - 'spec/requests/session_spec.rb' - - 'spec/requests/tag_spec.rb' - - 'spec/requests/ticket/article_spec.rb' - - 'spec/requests/ticket_spec.rb' - - 'spec/requests/time_accounting_spec.rb' - - 'spec/requests/user/permission_spec.rb' - - 'spec/requests/user_spec.rb' - - 'spec/system/manage/organizations_spec.rb' - 'spec/system/ticket/create_spec.rb' - - 'spec/system/ticket/zoom_spec.rb' - - 'spec/models/channel/filter/import_archive_spec.rb' RSpec/RepeatedDescription: Exclude: diff --git a/spec/requests/robots_txt_spec.rb b/spec/requests/robots_txt_spec.rb index b9496f802..f4f0a7707 100644 --- a/spec/requests/robots_txt_spec.rb +++ b/spec/requests/robots_txt_spec.rb @@ -48,14 +48,14 @@ RSpec.describe 'RobotsTxt', type: :request do context 'when custom domain is configured' do let(:custom_address) { 'kb.com/knowledge_base' } - context 'when requesting main domain' do # rubocop:disable RSpec/NestedGroups + context 'when requesting main domain' do it 'returns default rules' do expect(response.body).to include('Allow:').and(include('Disallow:')) end end - context 'when requesting KB domain' do # rubocop:disable RSpec/NestedGroups + context 'when requesting KB domain' do let(:server_name) { 'kb.com' } it 'returns domain rules' do