From 5841f1af8c5e04cecda03c206c7c1c5b9293413a Mon Sep 17 00:00:00 2001
From: Nick Schonning <nschonni@gmail.com>
Date: Wed, 26 Apr 2023 15:29:36 -0400
Subject: [PATCH] Autofix Rubocop RSpec/MatchArray (#24675)

---
 .rubocop_todo.yml                  | 9 ++-------
 spec/models/account_filter_spec.rb | 6 +++---
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index e84fa23e4f..73e69010cf 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1,6 +1,6 @@
 # This configuration was generated by
 # `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit --no-offense-counts --no-auto-gen-timestamp`
-# using RuboCop version 1.48.1.
+# using RuboCop version 1.50.2.
 # The point is for the user to remove these configuration records
 # one by one as the offenses are removed from the code base.
 # Note that changes in the inspected code, or installation of new
@@ -132,7 +132,6 @@ Lint/DuplicateBranch:
 Lint/EmptyBlock:
   Exclude:
     - 'spec/controllers/api/v2/search_controller_spec.rb'
-    - 'spec/controllers/application_controller_spec.rb'
     - 'spec/fabricators/access_token_fabricator.rb'
     - 'spec/fabricators/conversation_fabricator.rb'
     - 'spec/fabricators/system_key_fabricator.rb'
@@ -251,7 +250,6 @@ Metrics/ModuleLength:
     - 'app/controllers/concerns/signature_verification.rb'
     - 'app/helpers/application_helper.rb'
     - 'app/helpers/jsonld_helper.rb'
-    - 'app/helpers/statuses_helper.rb'
     - 'app/models/concerns/account_interactions.rb'
     - 'app/models/concerns/has_user_settings.rb'
 
@@ -370,6 +368,7 @@ Performance/MethodObjectAsBlock:
     - 'spec/models/export_spec.rb'
 
 # This cop supports unsafe autocorrection (--autocorrect-all).
+# Configuration parameters: AllowRegexpMatch.
 Performance/RedundantEqualityComparisonBlock:
   Exclude:
     - 'spec/requests/link_headers_spec.rb'
@@ -698,7 +697,6 @@ RSpec/HookArgument:
 RSpec/InstanceVariable:
   Exclude:
     - 'spec/controllers/api/v1/streaming_controller_spec.rb'
-    - 'spec/controllers/application_controller_spec.rb'
     - 'spec/controllers/auth/confirmations_controller_spec.rb'
     - 'spec/controllers/auth/passwords_controller_spec.rb'
     - 'spec/controllers/auth/sessions_controller_spec.rb'
@@ -752,7 +750,6 @@ RSpec/LetSetup:
     - 'spec/controllers/following_accounts_controller_spec.rb'
     - 'spec/controllers/oauth/authorized_applications_controller_spec.rb'
     - 'spec/controllers/oauth/tokens_controller_spec.rb'
-    - 'spec/controllers/tags_controller_spec.rb'
     - 'spec/lib/activitypub/activity/delete_spec.rb'
     - 'spec/lib/vacuum/preview_cards_vacuum_spec.rb'
     - 'spec/models/account_spec.rb'
@@ -818,7 +815,6 @@ RSpec/MissingExampleGroupArgument:
     - 'spec/controllers/api/v1/admin/account_actions_controller_spec.rb'
     - 'spec/controllers/api/v1/admin/domain_allows_controller_spec.rb'
     - 'spec/controllers/api/v1/statuses_controller_spec.rb'
-    - 'spec/controllers/application_controller_spec.rb'
     - 'spec/controllers/auth/registrations_controller_spec.rb'
     - 'spec/features/log_in_spec.rb'
     - 'spec/lib/activitypub/activity/undo_spec.rb'
@@ -2337,7 +2333,6 @@ Style/Semicolon:
   Exclude:
     - 'spec/services/activitypub/process_status_update_service_spec.rb'
     - 'spec/validators/blacklisted_email_validator_spec.rb'
-    - 'spec/workers/scheduler/accounts_statuses_cleanup_scheduler_spec.rb'
 
 # This cop supports safe autocorrection (--autocorrect).
 # Configuration parameters: EnforcedStyle.
diff --git a/spec/models/account_filter_spec.rb b/spec/models/account_filter_spec.rb
index 46513dbfa7..fa47b5954a 100644
--- a/spec/models/account_filter_spec.rb
+++ b/spec/models/account_filter_spec.rb
@@ -50,17 +50,17 @@ describe AccountFilter do
 
     it 'works with @ at the beginning of the username' do
       filter = described_class.new(username: '@validUserName')
-      expect(filter.results).to match_array [local_account]
+      expect(filter.results).to contain_exactly(local_account)
     end
 
     it 'does not work with more than one @ at the beginning of the username' do
       filter = described_class.new(username: '@@validUserName')
-      expect(filter.results).to_not match_array [local_account]
+      expect(filter.results).to_not contain_exactly(local_account)
     end
 
     it 'does not work with @ outside the beginning of the username' do
       filter = described_class.new(username: 'validUserName@')
-      expect(filter.results).to_not match_array [local_account]
+      expect(filter.results).to_not contain_exactly(local_account)
     end
   end
 end
-- 
GitLab