Autofix Rubocop RSpec/MatchArray (#24675)

This commit is contained in:
Nick Schonning 2023-04-26 15:29:36 -04:00 committed by GitHub
parent a3393d0d07
commit 5841f1af8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 10 deletions

View File

@ -1,6 +1,6 @@
# This configuration was generated by # This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit --no-offense-counts --no-auto-gen-timestamp` # `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 # The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base. # one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new # Note that changes in the inspected code, or installation of new
@ -132,7 +132,6 @@ Lint/DuplicateBranch:
Lint/EmptyBlock: Lint/EmptyBlock:
Exclude: Exclude:
- 'spec/controllers/api/v2/search_controller_spec.rb' - 'spec/controllers/api/v2/search_controller_spec.rb'
- 'spec/controllers/application_controller_spec.rb'
- 'spec/fabricators/access_token_fabricator.rb' - 'spec/fabricators/access_token_fabricator.rb'
- 'spec/fabricators/conversation_fabricator.rb' - 'spec/fabricators/conversation_fabricator.rb'
- 'spec/fabricators/system_key_fabricator.rb' - 'spec/fabricators/system_key_fabricator.rb'
@ -251,7 +250,6 @@ Metrics/ModuleLength:
- 'app/controllers/concerns/signature_verification.rb' - 'app/controllers/concerns/signature_verification.rb'
- 'app/helpers/application_helper.rb' - 'app/helpers/application_helper.rb'
- 'app/helpers/jsonld_helper.rb' - 'app/helpers/jsonld_helper.rb'
- 'app/helpers/statuses_helper.rb'
- 'app/models/concerns/account_interactions.rb' - 'app/models/concerns/account_interactions.rb'
- 'app/models/concerns/has_user_settings.rb' - 'app/models/concerns/has_user_settings.rb'
@ -370,6 +368,7 @@ Performance/MethodObjectAsBlock:
- 'spec/models/export_spec.rb' - 'spec/models/export_spec.rb'
# This cop supports unsafe autocorrection (--autocorrect-all). # This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowRegexpMatch.
Performance/RedundantEqualityComparisonBlock: Performance/RedundantEqualityComparisonBlock:
Exclude: Exclude:
- 'spec/requests/link_headers_spec.rb' - 'spec/requests/link_headers_spec.rb'
@ -698,7 +697,6 @@ RSpec/HookArgument:
RSpec/InstanceVariable: RSpec/InstanceVariable:
Exclude: Exclude:
- 'spec/controllers/api/v1/streaming_controller_spec.rb' - 'spec/controllers/api/v1/streaming_controller_spec.rb'
- 'spec/controllers/application_controller_spec.rb'
- 'spec/controllers/auth/confirmations_controller_spec.rb' - 'spec/controllers/auth/confirmations_controller_spec.rb'
- 'spec/controllers/auth/passwords_controller_spec.rb' - 'spec/controllers/auth/passwords_controller_spec.rb'
- 'spec/controllers/auth/sessions_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/following_accounts_controller_spec.rb'
- 'spec/controllers/oauth/authorized_applications_controller_spec.rb' - 'spec/controllers/oauth/authorized_applications_controller_spec.rb'
- 'spec/controllers/oauth/tokens_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/activitypub/activity/delete_spec.rb'
- 'spec/lib/vacuum/preview_cards_vacuum_spec.rb' - 'spec/lib/vacuum/preview_cards_vacuum_spec.rb'
- 'spec/models/account_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/account_actions_controller_spec.rb'
- 'spec/controllers/api/v1/admin/domain_allows_controller_spec.rb' - 'spec/controllers/api/v1/admin/domain_allows_controller_spec.rb'
- 'spec/controllers/api/v1/statuses_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/controllers/auth/registrations_controller_spec.rb'
- 'spec/features/log_in_spec.rb' - 'spec/features/log_in_spec.rb'
- 'spec/lib/activitypub/activity/undo_spec.rb' - 'spec/lib/activitypub/activity/undo_spec.rb'
@ -2337,7 +2333,6 @@ Style/Semicolon:
Exclude: Exclude:
- 'spec/services/activitypub/process_status_update_service_spec.rb' - 'spec/services/activitypub/process_status_update_service_spec.rb'
- 'spec/validators/blacklisted_email_validator_spec.rb' - 'spec/validators/blacklisted_email_validator_spec.rb'
- 'spec/workers/scheduler/accounts_statuses_cleanup_scheduler_spec.rb'
# This cop supports safe autocorrection (--autocorrect). # This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle. # Configuration parameters: EnforcedStyle.

View File

@ -50,17 +50,17 @@ describe AccountFilter do
it 'works with @ at the beginning of the username' do it 'works with @ at the beginning of the username' do
filter = described_class.new(username: '@validUserName') filter = described_class.new(username: '@validUserName')
expect(filter.results).to match_array [local_account] expect(filter.results).to contain_exactly(local_account)
end end
it 'does not work with more than one @ at the beginning of the username' do it 'does not work with more than one @ at the beginning of the username' do
filter = described_class.new(username: '@@validUserName') 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
it 'does not work with @ outside the beginning of the username' do it 'does not work with @ outside the beginning of the username' do
filter = described_class.new(username: 'validUserName@') 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 end
end end