From c220791d85fb1153fee6b7e2a3521b770532bf69 Mon Sep 17 00:00:00 2001 From: Aaron Lambley Date: Thu, 18 Jan 2024 11:06:08 +0000 Subject: [PATCH 1/2] setup rubocop --- .rubocop.yml | 451 ++++++++++++++++- .rubocop_todo.yml | 1213 +++++++++++++++++++++++++++++++++++++++++++++ Gemfile | 6 +- Gemfile.lock | 2 +- 4 files changed, 1641 insertions(+), 31 deletions(-) create mode 100644 .rubocop_todo.yml diff --git a/.rubocop.yml b/.rubocop.yml index e32864d88..d2abc5a8c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,5 @@ -# inherit_from: -# - .rubocop_todo.yml - +inherit_from: + - .rubocop_todo.yml AllCops: TargetRubyVersion: 2.7 # Exclude anything that isn't really part of our code. @@ -26,26 +25,31 @@ AllCops: # Allow long lines in specs, as it's almost impossible to fit RSpec's # expectations into 80 characters. -Metrics/LineLength: - Max: 120 +Layout/LineLength: + Max: 180 Exclude: - 'features/**/*' - 'spec/**/*' - 'Gemfile' -Metrics/ClassLength: - Exclude: - - 'app/forms/**/*' - - 'features/support/page_objects/**/*' - - 'features/support/sections/**/*' Metrics/ModuleLength: + Max: 120 Exclude: - 'spec/forms/**/*' - 'features/support/page_objects/**/*' - 'features/support/sections/**/*' Metrics/AbcSize: + Max: 35 + Exclude: + - 'spec/**/*' + - 'test_common/**/*' +Metrics/ParameterLists: + Max: 7 +Metrics/CyclomaticComplexity: + Exclude: + - 'spec/**/*' +Metrics/PerceivedComplexity: Exclude: - 'spec/**/*' - Max: 20 # Allow expect {}.to blocks in specs # but not in the code @@ -54,11 +58,15 @@ Style/BlockDelimiters: Exclude: - 'spec/**/*' -Naming/PredicateName: - Enabled: false - +Style/AsciiComments: + Enabled: true + Exclude: + - 'spec/**/*' +Layout/TrailingEmptyLines: + Enabled: true # Don't worry about long methods in specs. Metrics/MethodLength: + Max: 15 Exclude: - 'spec/**/*' - 'app/models/ability.rb' @@ -70,6 +78,10 @@ RSpec/DescribeClass: - spec/support/**/* - spec/views/**/* +Rails/FilePath: + Exclude: + - spec/routing/**/* + # private/protected/public Layout/AccessModifierIndentation: EnforcedStyle: indent @@ -81,7 +93,6 @@ Layout/ParameterAlignment: Style/ClassAndModuleChildren: EnforcedStyle: nested - Enabled: false Style/CollectionMethods: PreferredMethods: @@ -139,20 +150,28 @@ Style/SignalException: Style/TrivialAccessors: AllowPredicates: true +Style/MixinUsage: + Enabled: true + Exclude: + - 'spec/**/*' + - 'features/**/*' + # Prefer sensible naming to comments everywhere. -Documentation: +Style/Documentation: Description: Document classes and non-namespace modules. Enabled: false # Would enforce do_y if x over if x / do y / end. As with GuardClause above, # this enforces code organisation that doesn't necesarily make things clearer. -IfUnlessModifier: +Style/IfUnlessModifier: Enabled: false # Allow safe assignment in conditions. Lint/AssignmentInCondition: AllowSafeAssignment: false - +Lint/EmptyFile: + Exclude: + - 'config/nulldb_schema.rb' # Just a preference to use %w[] over %w() Style/PercentLiteralDelimiters: PreferredDelimiters: @@ -160,15 +179,13 @@ Style/PercentLiteralDelimiters: '%W': '[]' '%i': '[]' +# %w doesn't always make for clearer test data Style/WordArray: EnforcedStyle: brackets Style/SymbolArray: EnforcedStyle: brackets -Style/RegexpLiteral: - Enabled: false - RSpec/NestedGroups: Max: 10 @@ -184,10 +201,20 @@ Metrics/BlockLength: - 'features/step_definitions/**/*' - 'features/support/page_objects/**/*' - 'features/support/sections/**/*' +Metrics/ClassLength: + Exclude: + - 'spec/support/**/*' Layout/EmptyLineAfterMagicComment: Enabled: false +# --------------- +# HttpPositionalArguments is rails 5 only +# https://github.com/bbatsov/rubocop/issues/3629 +# --------------- +Rails/HttpPositionalArguments: + Enabled: false + RSpec/MultipleExpectations: Exclude: - 'spec/features/**/*' @@ -195,17 +222,387 @@ RSpec/MultipleExpectations: RSpec/ExampleLength: Exclude: - 'spec/**/*' - +RSpec/MultipleMemoizedHelpers: + Max: 20 Style/NumericPredicate: Exclude: - 'spec/**/*' -RSpec/VerifiedDoubles: +Rails/OutputSafety: + Exclude: + - 'app/helpers/yaml_helper.rb' +RSpec/Capybara: + Exclude: + - 'spec/features/**/*' + +Naming/PredicateName: Exclude: - - 'spec/forms/refunds/**/*_spec.rb' + - 'spec/support/**/*' -RSpec/MessageSpies: - EnforcedStyle: receive -require: +Gemspec/DeprecatedAttributeAssignment: # new in 1.30 + Enabled: true +Gemspec/DevelopmentDependencies: # new in 1.44 + Enabled: true +Gemspec/RequireMFA: # new in 1.23 + Enabled: true +Layout/LineContinuationLeadingSpace: # new in 1.31 + Enabled: true +Layout/LineContinuationSpacing: # new in 1.31 + Enabled: true +Layout/LineEndStringConcatenationIndentation: # new in 1.18 + Enabled: true +Layout/SpaceBeforeBrackets: # new in 1.7 + Enabled: true +Lint/AmbiguousAssignment: # new in 1.7 + Enabled: true +Lint/AmbiguousOperatorPrecedence: # new in 1.21 + Enabled: true +Lint/AmbiguousRange: # new in 1.19 + Enabled: true +Lint/ConstantOverwrittenInRescue: # new in 1.31 + Enabled: true +Lint/DeprecatedConstants: # new in 1.8 + Enabled: true +Lint/DuplicateBranch: # new in 1.3 + Enabled: true +Lint/DuplicateMagicComment: # new in 1.37 + Enabled: true +Lint/DuplicateMatchPattern: # new in 1.50 + Enabled: true +Lint/DuplicateRegexpCharacterClassElement: # new in 1.1 + Enabled: true +Lint/EmptyBlock: # new in 1.1 + Enabled: true +Lint/EmptyClass: # new in 1.3 + Enabled: true +Lint/EmptyInPattern: # new in 1.16 + Enabled: true +Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21 + Enabled: true +Lint/LambdaWithoutLiteralBlock: # new in 1.8 + Enabled: true +Lint/MixedCaseRange: # new in 1.53 + Enabled: true +Lint/NoReturnInBeginEndBlocks: # new in 1.2 + Enabled: true +Lint/NonAtomicFileOperation: # new in 1.31 + Enabled: true +Lint/NumberedParameterAssignment: # new in 1.9 + Enabled: true +Lint/OrAssignmentToConstant: # new in 1.9 + Enabled: true +Lint/RedundantDirGlobSort: # new in 1.8 + Enabled: true +Lint/RedundantRegexpQuantifiers: # new in 1.53 + Enabled: true +Lint/RefinementImportMethods: # new in 1.27 + Enabled: true +Lint/RequireRangeParentheses: # new in 1.32 + Enabled: true +Lint/RequireRelativeSelfPath: # new in 1.22 + Enabled: true +Lint/SymbolConversion: # new in 1.9 + Enabled: true +Lint/ToEnumArguments: # new in 1.1 + Enabled: true +Lint/TripleQuotes: # new in 1.9 + Enabled: true +Lint/UnexpectedBlockArity: # new in 1.5 + Enabled: true +Lint/UnmodifiedReduceAccumulator: # new in 1.1 + Enabled: true +Lint/UselessRescue: # new in 1.43 + Enabled: true +Lint/UselessRuby2Keywords: # new in 1.23 + Enabled: true +Metrics/CollectionLiteralLength: # new in 1.47 + Enabled: true +Naming/BlockForwarding: # new in 1.24 + Enabled: true +Security/CompoundHash: # new in 1.28 + Enabled: true +Security/IoMethods: # new in 1.22 + Enabled: true +Style/ArgumentsForwarding: # new in 1.1 + Enabled: true +Style/ArrayIntersect: # new in 1.40 + Enabled: true +Style/CollectionCompact: # new in 1.2 + Enabled: true +Style/ComparableClamp: # new in 1.44 + Enabled: true +Style/ConcatArrayLiterals: # new in 1.41 + Enabled: true +Style/DataInheritance: # new in 1.49 + Enabled: true +Style/DirEmpty: # new in 1.48 + Enabled: true +Style/DocumentDynamicEvalDefinition: # new in 1.1 + Enabled: true +Style/EmptyHeredoc: # new in 1.32 + Enabled: true +Style/EndlessMethod: # new in 1.8 + Enabled: true +Style/EnvHome: # new in 1.29 + Enabled: true +Style/ExactRegexpMatch: # new in 1.51 + Enabled: true +Style/FetchEnvVar: # new in 1.28 + Enabled: true +Style/FileEmpty: # new in 1.48 + Enabled: true +Style/FileRead: # new in 1.24 + Enabled: true +Style/FileWrite: # new in 1.24 + Enabled: true +Style/HashConversion: # new in 1.10 + Enabled: true +Style/HashExcept: # new in 1.7 + Enabled: true +Style/IfWithBooleanLiteralBranches: # new in 1.9 + Enabled: true +Style/InPatternThen: # new in 1.16 + Enabled: true +Style/MagicCommentFormat: # new in 1.35 + Enabled: true +Style/MapCompactWithConditionalBlock: # new in 1.30 + Enabled: true +Style/MapToHash: # new in 1.24 + Enabled: true +Style/MapToSet: # new in 1.42 + Enabled: true +Style/MinMaxComparison: # new in 1.42 + Enabled: true +Style/MultilineInPatternThen: # new in 1.16 + Enabled: true +Style/NegatedIfElseCondition: # new in 1.2 + Enabled: true +Style/NestedFileDirname: # new in 1.26 + Enabled: true +Style/NilLambda: # new in 1.3 + Enabled: true +Style/NumberedParameters: # new in 1.22 + Enabled: true +Style/NumberedParametersLimit: # new in 1.22 + Enabled: true +Style/ObjectThen: # new in 1.28 + Enabled: true +Style/OpenStructUse: # new in 1.23 + Enabled: false +Style/OperatorMethodCall: # new in 1.37 + Enabled: true +Style/QuotedSymbols: # new in 1.16 + Enabled: true +Style/RedundantArgument: # new in 1.4 + Enabled: true +Style/RedundantArrayConstructor: # new in 1.52 + Enabled: true +Style/RedundantConstantBase: # new in 1.40 + Enabled: false +Style/RedundantCurrentDirectoryInPath: # new in 1.53 + Enabled: true +Style/RedundantDoubleSplatHashBraces: # new in 1.41 + Enabled: true +Style/RedundantEach: # new in 1.38 + Enabled: true +Style/RedundantFilterChain: # new in 1.52 + Enabled: true +Style/RedundantHeredocDelimiterQuotes: # new in 1.45 + Enabled: true +Style/RedundantInitialize: # new in 1.27 + Enabled: true +Style/RedundantLineContinuation: # new in 1.49 + Enabled: true +Style/RedundantRegexpArgument: # new in 1.53 + Enabled: true +Style/RedundantRegexpConstructor: # new in 1.52 + Enabled: true +Style/RedundantSelfAssignmentBranch: # new in 1.19 + Enabled: true +Style/RedundantStringEscape: # new in 1.37 + Enabled: true +Style/ReturnNilInPredicateMethodDefinition: # new in 1.53 + Enabled: true +Style/SelectByRegexp: # new in 1.22 + Enabled: true +Style/StringChars: # new in 1.12 + Enabled: true +Style/SwapValues: # new in 1.1 + Enabled: true +Style/YAMLFileRead: # new in 1.53 + Enabled: true +Capybara/MatchStyle: # new in 2.17 + Enabled: true +Capybara/NegationMatcher: # new in 2.14 + Enabled: true +Capybara/SpecificActions: # new in 2.14 + Enabled: true +Capybara/SpecificFinders: # new in 2.13 + Enabled: true +Capybara/SpecificMatcher: # new in 2.12 + Enabled: true +FactoryBot/AssociationStyle: # new in 2.23 + Enabled: false +FactoryBot/ConsistentParenthesesStyle: # new in 2.14 + Enabled: true +FactoryBot/FactoryAssociationWithStrategy: # new in 2.23 + Enabled: false +FactoryBot/FactoryNameStyle: # new in 2.16 + Enabled: true +FactoryBot/RedundantFactoryOption: # new in 2.23 + Enabled: true +FactoryBot/SyntaxMethods: # new in 2.7 + Enabled: true +RSpec/BeEmpty: # new in 2.20 + Enabled: true +RSpec/BeEq: # new in 2.9.0 + Enabled: true +RSpec/BeNil: # new in 2.9.0 + Enabled: true +RSpec/ChangeByZero: # new in 2.11 + Enabled: true +RSpec/ContainExactly: # new in 2.19 + Enabled: true +RSpec/DuplicatedMetadata: # new in 2.16 + Enabled: true +RSpec/ExcessiveDocstringSpacing: # new in 2.5 + Enabled: true +RSpec/IdenticalEqualityAssertion: # new in 2.4 + Enabled: true +RSpec/IndexedLet: # new in 2.20 + Enabled: true +RSpec/MatchArray: # new in 2.19 + Enabled: true +RSpec/NoExpectationExample: # new in 2.13 + Enabled: false +RSpec/PendingWithoutReason: # new in 2.16 + Enabled: true +RSpec/RedundantAround: # new in 2.19 + Enabled: true +RSpec/SkipBlockInsideExample: # new in 2.19 + Enabled: true +RSpec/SortMetadata: # new in 2.14 + Enabled: true +RSpec/SubjectDeclaration: # new in 2.5 + Enabled: true +RSpec/VerifiedDoubleReference: # new in 2.10.0 + Enabled: false +RSpec/Rails/AvoidSetupHook: # new in 2.4 + Enabled: true +RSpec/Rails/HaveHttpStatus: # new in 2.12 + Enabled: true +RSpec/Rails/InferredSpecType: # new in 2.14 + Enabled: false +RSpec/Rails/MinitestAssertions: # new in 2.17 + Enabled: true +RSpec/Rails/TravelAround: # new in 2.19 + Enabled: true +Rails/ActionControllerFlashBeforeRender: # new in 2.16 + Enabled: true +Rails/ActionControllerTestCase: # new in 2.14 + Enabled: true +Rails/ActionOrder: # new in 2.17 + Enabled: true +Rails/ActiveRecordCallbacksOrder: # new in 2.7 + Enabled: true +Rails/ActiveSupportOnLoad: # new in 2.16 + Enabled: true +Rails/AddColumnIndex: # new in 2.11 + Enabled: true +Rails/AfterCommitOverride: # new in 2.8 + Enabled: true +Rails/AttributeDefaultBlockValue: # new in 2.9 + Enabled: true +Rails/CompactBlank: # new in 2.13 + Enabled: true +Rails/DeprecatedActiveModelErrorsMethods: # new in 2.14 + Enabled: true +Rails/DotSeparatedKeys: # new in 2.15 + Enabled: true +Rails/DuplicateAssociation: # new in 2.14 + Enabled: true +Rails/DuplicateScope: # new in 2.14 + Enabled: true +Rails/DurationArithmetic: # new in 2.13 + Enabled: true +Rails/EagerEvaluationLogMessage: # new in 2.11 + Enabled: true +Rails/ExpandedDateRange: # new in 2.11 + Enabled: true +Rails/FindById: # new in 2.7 + Enabled: true +Rails/FreezeTime: # new in 2.16 + Enabled: true +Rails/I18nLazyLookup: # new in 2.14 + Enabled: true +Rails/I18nLocaleAssignment: # new in 2.11 + Enabled: true +Rails/I18nLocaleTexts: # new in 2.14 + Enabled: true +Rails/IgnoredColumnsAssignment: # new in 2.17 + Enabled: true +Rails/Inquiry: # new in 2.7 + Enabled: true +Rails/MailerName: # new in 2.7 + Enabled: true +Rails/MatchRoute: # new in 2.7 + Enabled: true +Rails/MigrationClassName: # new in 2.14 + Enabled: true +Rails/NegateInclude: # new in 2.7 + Enabled: true +Rails/Pluck: # new in 2.7 + Enabled: true +Rails/PluckInWhere: # new in 2.7 + Enabled: true +Rails/RedundantPresenceValidationOnBelongsTo: # new in 2.13 + Enabled: true +Rails/RedundantTravelBack: # new in 2.12 + Enabled: true +Rails/RenderInline: # new in 2.7 + Enabled: true +Rails/RenderPlainText: # new in 2.7 + Enabled: true +Rails/ResponseParsedBody: # new in 2.18 + Enabled: false +Rails/RootJoinChain: # new in 2.13 + Enabled: true +Rails/RootPathnameMethods: # new in 2.16 + Enabled: true +Rails/RootPublicPath: # new in 2.15 + Enabled: true +Rails/ShortI18n: # new in 2.7 + Enabled: true +Rails/SquishedSQLHeredocs: # new in 2.8 + Enabled: true +Rails/StripHeredoc: # new in 2.15 + Enabled: true +Rails/ThreeStateBooleanColumn: # new in 2.19 + Enabled: true +Rails/TimeZoneAssignment: # new in 2.10 + Enabled: true +Rails/ToFormattedS: # new in 2.15 + Enabled: true +Rails/ToSWithArgument: # new in 2.16 + Enabled: true +Rails/TopLevelHashWithIndifferentAccess: # new in 2.16 + Enabled: true +Rails/TransactionExitStatement: # new in 2.14 + Enabled: true +Rails/UnusedIgnoredColumns: # new in 2.11 + Enabled: true +Rails/WhereEquals: # new in 2.9 + Enabled: true +Rails/WhereExists: # new in 2.7 + Enabled: true +Rails/WhereMissing: # new in 2.16 + Enabled: true +Rails/WhereNot: # new in 2.8 + Enabled: true +Rails/WhereNotWithMultipleConditions: # new in 2.17 + Enabled: true +require: - rubocop-rspec - rubocop-rails + - rubocop-factory_bot + diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 000000000..16a95cf2e --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,1213 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2024-01-18 10:22:53 UTC using RuboCop version 1.60.0. +# 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 +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +Capybara/CurrentPathExpectation: + Exclude: + - 'spec/features/language_switch_spec.rb' + +# Offense count: 23 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: have_no, not_to +Capybara/NegationMatcher: + Exclude: + - 'spec/features/admin_panel/admin_show_feature_spec.rb' + - 'spec/features/claimant_spec.rb' + - 'spec/features/create_claim_applications_spec.rb' + - 'spec/features/multiple_claimants_spec.rb' + - 'spec/features/multiple_respondents_spec.rb' + - 'spec/support/page_objects/about_the_claim_page.rb' + +# Offense count: 43 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Include, EnforcedStyle, ExplicitOnly. +# Include: **/*_spec.rb, **/spec/**/*, **/test/**/*, **/features/support/factories/**/*.rb +# SupportedStyles: require_parentheses, omit_parentheses +FactoryBot/ConsistentParenthesesStyle: + Enabled: false + +# Offense count: 16 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: with_first_argument, with_fixed_indentation +Layout/ArgumentAlignment: + Exclude: + - 'node_modules/et_gds_design_system/app/services/et_gds_design_system/api/show_blob_service.rb' + - 'node_modules/et_gds_design_system/test/dummy/bin/webpack' + - 'node_modules/et_gds_design_system/test/dummy/bin/webpack-dev-server' + - 'spec/support/api_support/json_objects/v2/claimant_json_object.rb' + - 'spec/support/form_methods.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyleAlignWith. +# SupportedStylesAlignWith: either, start_of_block, start_of_line +Layout/BlockAlignment: + Exclude: + - 'app/forms/representative_form.rb' + - 'spec/support/capybara_selectors/button_translated.rb' + - 'spec/support/capybara_selectors/field_translated.rb' + +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowForAlignment. +Layout/CommentIndentation: + Exclude: + - 'spec/support/page_objects/claim_details_page.rb' + - 'spec/support/page_objects/respondents_details_page.rb' + - 'spec/support/test_user.rb' + +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: leading, trailing +Layout/DotPosition: + Exclude: + - 'config/environments/production.rb' + - 'spec/support/capybara_selectors/refund_review_selectors.rb' + +# Offense count: 13 +# This cop supports safe autocorrection (--autocorrect). +Layout/EmptyLineAfterGuardClause: + Exclude: + - 'import-secrets.rb' + - 'spec/support/api_support/json_objects/v2/primary_claimant_json_object.rb' + - 'spec/support/matchers/be_a_valid_api_command.rb' + - 'spec/support/page_objects/additional_respondents_page.rb' + - 'spec/support/page_objects/claim_submitted_page.rb' + - 'spec/support/page_objects/claimants_details_page.rb' + - 'spec/support/page_objects/group_claims_page.rb' + - 'spec/support/page_objects/representatives_details_page.rb' + - 'spec/support/page_objects/reset_memorable_word_page.rb' + - 'spec/support/page_objects/respondents_details_page.rb' + - 'spec/support/refunds_steps/fees_steps.rb' + - 'spec/support/refunds_steps/review_steps.rb' + +# Offense count: 7 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, DefLikeMacros, AllowAdjacentOneLineDefs, NumberOfEmptyLines. +Layout/EmptyLineBetweenDefs: + Exclude: + - 'spec/support/page_objects/claimants_details_page.rb' + - 'spec/support/page_objects/employment_details_page.rb' + - 'spec/support/page_objects/respondents_details_page.rb' + - 'spec/support/refunds_steps/applicant_steps.rb' + - 'spec/support/refunds_steps/original_case_details_steps.rb' + +# Offense count: 15 +# This cop supports safe autocorrection (--autocorrect). +Layout/EmptyLines: + Exclude: + - 'config/environments/development.rb' + - 'config/environments/test.rb' + - 'node_modules/et_gds_design_system/test/dummy/config/environments/development.rb' + - 'spec/support/page_objects/about_the_claim_page.rb' + - 'spec/support/page_objects/check_your_claim_page.rb' + - 'spec/support/page_objects/claim_outcome_page.rb' + - 'spec/support/page_objects/claimants_details_page.rb' + - 'spec/support/page_objects/employment_details_page.rb' + - 'spec/support/page_objects/group_claims_upload_page.rb' + - 'spec/support/page_objects/more_about_the_claim_page.rb' + - 'spec/support/page_objects/representatives_details_page.rb' + - 'spec/support/page_objects/save_and_complete_later_page.rb' + - 'spec/support/refunds_steps/original_case_details_steps.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +Layout/EmptyLinesAroundExceptionHandlingKeywords: + Exclude: + - 'spec/support/api_support/json_objects/v2/build_claim_json_object.rb' + - 'spec/support/api_support/json_objects/v2/representative_json_object.rb' + - 'spec/support/api_support/json_objects/v2/respondent_json_object.rb' + +# Offense count: 10 +# This cop supports safe autocorrection (--autocorrect). +Layout/EmptyLinesAroundMethodBody: + Exclude: + - 'spec/support/api_support/json_objects/base.rb' + - 'spec/support/page_objects/check_your_claim_page.rb' + - 'spec/support/page_objects/saving_your_claim_page.rb' + - 'spec/support/refunds_steps/applicant_steps.rb' + - 'spec/support/refunds_steps/original_case_details_steps.rb' + - 'spec/support/refunds_steps/payment_details_steps.rb' + - 'spec/support/refunds_steps/review_steps.rb' + - 'spec/support/refunds_steps/setup_steps.rb' + +# Offense count: 5 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment. +Layout/ExtraSpacing: + Exclude: + - 'app/forms/respondent_form.rb' + - 'spec/support/rails_session_cookie_support.rb' + - 'spec/validators/dx_string_validator_spec.rb' + - 'spec/validators/special_character_validator_spec.rb' + +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: special_inside_parentheses, consistent, align_brackets +Layout/FirstArrayElementIndentation: + Exclude: + - 'node_modules/et_gds_design_system/spec/support/webmock.rb' + - 'spec/support/webmock.rb' + +# Offense count: 13 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. +# SupportedHashRocketStyles: key, separator, table +# SupportedColonStyles: key, separator, table +# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit +Layout/HashAlignment: + Exclude: + - 'node_modules/et_gds_design_system/spec/support/webmock.rb' + - 'spec/support/api_support/json_objects/v2/claimant_json_object.rb' + - 'spec/support/webmock.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: normal, indented_internal_methods +Layout/IndentationConsistency: + Exclude: + - 'spec/support/capybara_selectors/button_translated.rb' + - 'spec/support/capybara_selectors/field_translated.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Width, AllowedPatterns. +Layout/IndentationWidth: + Exclude: + - 'spec/support/capybara_selectors/button_translated.rb' + - 'spec/support/capybara_selectors/field_translated.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment. +Layout/LeadingCommentSpace: + Exclude: + - 'spec/support/webmock.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +Layout/LeadingEmptyLines: + Exclude: + - 'spec/support/page_objects/step_ten_page.rb' + - 'spec/support/page_objects/submission_page.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: aligned, indented +Layout/LineEndStringConcatenationIndentation: + Exclude: + - 'spec/views/claim_reviews/show/review_page_claim_outcome_spec.rb' + +# Offense count: 8 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. +# URISchemes: http, https +Layout/LineLength: + Exclude: + - 'app/models/claim.rb' + - 'node_modules/et_gds_design_system/lib/et_gds_design_system/form/builder.rb' + - 'node_modules/et_gds_design_system/spec/support/capybara-screenshot.rb' + +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: aligned, indented, indented_relative_to_receiver +Layout/MultilineMethodCallIndentation: + Exclude: + - 'config/environments/production.rb' + - 'spec/support/rails_session_cookie_support.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: aligned, indented +Layout/MultilineOperationIndentation: + Exclude: + - 'spec/support/capybara_selectors/refund_review_selectors.rb' + +# Offense count: 19 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: with_first_parameter, with_fixed_indentation +Layout/ParameterAlignment: + Exclude: + - 'node_modules/et_gds_design_system/app/services/et_gds_design_system/api/create_blob_service.rb' + - 'node_modules/et_gds_design_system/app/services/et_gds_design_system/api/show_blob_service.rb' + - 'node_modules/et_gds_design_system/app/services/et_gds_design_system/api_service.rb' + - 'node_modules/et_gds_design_system/lib/et_gds_design_system/elements/file_dropzone.rb' + - 'node_modules/et_gds_design_system/lib/et_gds_design_system/form/builder.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyleInsidePipes. +# SupportedStylesInsidePipes: space, no_space +Layout/SpaceAroundBlockParameters: + Exclude: + - 'spec/support/page_objects/additional_respondents_page.rb' + - 'spec/support/page_objects/group_claims_page.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Layout/SpaceAroundKeyword: + Exclude: + - 'spec/support/page_objects/additional_respondents_page.rb' + +# Offense count: 5 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator, EnforcedStyleForRationalLiterals. +# SupportedStylesForExponentOperator: space, no_space +# SupportedStylesForRationalLiterals: space, no_space +Layout/SpaceAroundOperators: + Exclude: + - 'spec/support/capybara_driver_helper.rb' + - 'spec/support/page_objects/additional_respondents_page.rb' + - 'spec/support/page_objects/group_claims_page.rb' + - 'spec/support/page_objects/review_page.rb' + +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets. +# SupportedStyles: space, no_space, compact +# SupportedStylesForEmptyBrackets: space, no_space +Layout/SpaceInsideArrayLiteralBrackets: + Exclude: + - 'config/environments/production.rb' + - 'node_modules/et_gds_design_system/test/dummy/config/environments/production.rb' + +# Offense count: 18 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters. +# SupportedStyles: space, no_space +# SupportedStylesForEmptyBraces: space, no_space +Layout/SpaceInsideBlockBraces: + Exclude: + - 'spec/support/api_support/json_objects/base.rb' + - 'spec/support/page_objects/additional_respondents_page.rb' + - 'spec/support/page_objects/base_page.rb' + - 'spec/support/page_objects/group_claims_page.rb' + - 'spec/support/sections/date_question_section.rb' + +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces. +# SupportedStyles: space, no_space, compact +# SupportedStylesForEmptyBraces: space, no_space +Layout/SpaceInsideHashLiteralBraces: + Exclude: + - 'spec/support/api_support/json_objects/v2/primary_claimant_json_object.rb' + +# Offense count: 6 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: final_newline, final_blank_line +Layout/TrailingEmptyLines: + Exclude: + - 'app/validators/dx_string_validator.rb' + - 'node_modules/et_gds_design_system/spec/support/capybara-screenshot.rb' + - 'node_modules/et_gds_design_system/test/dummy/config/application.rb' + - 'node_modules/et_gds_design_system/test/test_helper.rb' + - 'spec/support/gov_fake_notify.rb' + - 'spec/support/shared_contexts/fake_gov_notify.rb' + +# Offense count: 8 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowedMethods, AllowedPatterns. +Lint/AmbiguousBlockAssociation: + Exclude: + - 'spec/support/page_objects/additional_respondents_page.rb' + - 'spec/support/page_objects/base_page.rb' + - 'spec/support/page_objects/employment_details_page.rb' + - 'spec/support/page_objects/group_claims_page.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Lint/AmbiguousOperator: + Exclude: + - 'app/models/application_record.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Lint/AmbiguousRegexpLiteral: + Exclude: + - 'spec/support/page_objects/group_claims_page.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowSafeAssignment. +Lint/AssignmentInCondition: + Exclude: + - 'app/forms/concerns/validate_nested.rb' + +# Offense count: 9 +# Configuration parameters: AllowedMethods. +# AllowedMethods: enums +Lint/ConstantDefinitionInBlock: + Exclude: + - 'spec/support/active_job.rb' + - 'spec/types/et_date_spec.rb' + - 'spec/validators/additional_claimants_csv_validator_spec.rb' + - 'spec/validators/date_range_validator_spec.rb' + - 'spec/validators/date_validator_spec.rb' + - 'spec/validators/dx_string_validator_spec.rb' + - 'spec/validators/special_character_validator_spec.rb' + +# Offense count: 4 +# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches. +Lint/DuplicateBranch: + Exclude: + - 'app/validators/date_validator.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Lint/DuplicateMagicComment: + Exclude: + - 'spec/controllers/cookies_controller_spec.rb' + +# Offense count: 1 +Lint/DuplicateMethods: + Exclude: + - 'spec/support/page_object_helpers.rb' + +# Offense count: 4 +# Configuration parameters: AllowComments, AllowEmptyLambdas. +Lint/EmptyBlock: + Exclude: + - 'spec/factories/ui/claim_outcome_ui_factory.rb' + - 'spec/factories/ui/claim_type_ui_factory.rb' + - 'spec/factories/ui/employment_ui_factory.rb' + - 'spec/factories/ui/more_about_the_claim_ui_factory.rb' + +# Offense count: 1 +# Configuration parameters: AllowComments. +Lint/EmptyFile: + Exclude: + - 'node_modules/et_gds_design_system/test/dummy/config/nulldb_schema.rb' + +# Offense count: 3 +Lint/HashCompareByIdentity: + Exclude: + - 'app/forms/form_collection_proxy.rb' + +# Offense count: 3 +Lint/IneffectiveAccessModifier: + Exclude: + - 'app/models/application_record.rb' + - 'spec/support/messaging.rb' + +# Offense count: 3 +# Configuration parameters: MaximumRangeSize. +Lint/MissingCopEnableDirective: + Exclude: + - 'app/admin/claim.rb' + - 'app/forms/address_attributes.rb' + - 'spec/support/test_user.rb' + +# Offense count: 2 +# Configuration parameters: AllowedParentClasses. +Lint/MissingSuper: + Exclude: + - 'spec/support/email_support/email_objects/reset_password_email_html.rb' + - 'spec/support/page_objects/base_page.rb' + +# Offense count: 3 +# This cop supports unsafe autocorrection (--autocorrect-all). +Lint/NonDeterministicRequireOrder: + Exclude: + - 'spec/support/capybara_selectors.rb' + - 'spec/support/page_objects.rb' + - 'spec/support/sections.rb' + +# Offense count: 7 +# This cop supports safe autocorrection (--autocorrect). +Lint/RedundantCopDisableDirective: + Exclude: + - 'spec/support/email_support/email_objects/reset_password_email_html.rb' + - 'spec/support/email_support/email_objects/reset_password_email_text.rb' + - 'spec/support/test_user.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +Lint/RedundantCopEnableDirective: + Exclude: + - 'spec/support/page_objects/step_seven_page.rb' + - 'spec/support/page_objects/step_three_page.rb' + - 'spec/support/page_objects/step_two_page.rb' + +# Offense count: 79 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: strict, consistent +Lint/SymbolConversion: + Exclude: + - 'app/services/api_service.rb' + - 'node_modules/et_gds_design_system/app/services/et_gds_design_system/api/create_blob_service.rb' + - 'node_modules/et_gds_design_system/app/services/et_gds_design_system/api/show_blob_service.rb' + - 'node_modules/et_gds_design_system/app/services/et_gds_design_system/api_service.rb' + - 'node_modules/et_gds_design_system/lib/et_gds_design_system/form/builder.rb' + - 'spec/forms/refunds/fees_form_spec.rb' + - 'spec/support/refunds_steps/applicant_steps.rb' + - 'spec/support/refunds_steps/fees_steps.rb' + - 'spec/support/refunds_steps/original_case_details_steps.rb' + - 'spec/support/refunds_steps/payment_details_steps.rb' + - 'spec/support/refunds_steps/review_steps.rb' + - 'spec/validators/additional_claimants_csv_validator_spec.rb' + +# Offense count: 12 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods. +Lint/UnusedMethodArgument: + Exclude: + - 'app/models/application_record.rb' + - 'node_modules/et_gds_design_system/app/services/et_gds_design_system/api/show_blob_service.rb' + - 'node_modules/et_gds_design_system/lib/et_gds_design_system/elements/file_dropzone.rb' + - 'node_modules/et_gds_design_system/lib/et_gds_design_system/form/builder.rb' + - 'spec/support/api_support/json_objects/v2/claimants_json_object.rb' + - 'spec/support/email_support/email_objects/reset_password_email_html.rb' + - 'spec/support/email_support/email_objects/reset_password_email_text.rb' + +# Offense count: 25 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: ContextCreatingMethods, MethodCreatingMethods. +Lint/UselessAccessModifier: + Enabled: false + +# Offense count: 6 +# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode. +# AllowedMethods: refine +Metrics/BlockLength: + Max: 60 + +# Offense count: 3 +# Configuration parameters: CountComments, CountAsOne. +Metrics/ClassLength: + Max: 217 + +# Offense count: 2 +# Configuration parameters: AllowedMethods, AllowedPatterns. +Metrics/CyclomaticComplexity: + Max: 8 + +# Offense count: 4 +# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns. +Metrics/MethodLength: + Exclude: + - 'app/forms/concerns/validate_nested.rb' + - 'app/forms/form.rb' + - 'app/validators/additional_claimants_csv_validator.rb' + +# Offense count: 5 +# Configuration parameters: CountComments, Max, CountAsOne. +Metrics/ModuleLength: + Exclude: + - 'spec/forms/refunds/applicant_form_spec.rb' + - 'spec/forms/refunds/fees_form_spec.rb' + - 'spec/forms/refunds/original_case_details_form_spec.rb' + - 'spec/support/form_methods.rb' + - 'spec/support/page_object_helpers.rb' + +# Offense count: 8 +# Configuration parameters: Max, CountKeywordArgs, MaxOptionalParameters. +Metrics/ParameterLists: + Exclude: + - 'node_modules/et_gds_design_system/lib/et_gds_design_system/elements/file_dropzone.rb' + - 'node_modules/et_gds_design_system/lib/et_gds_design_system/form/builder.rb' + +# Offense count: 1 +# Configuration parameters: AllowedMethods, AllowedPatterns. +Metrics/PerceivedComplexity: + Max: 9 + +# Offense count: 1 +Naming/AccessorMethodName: + Exclude: + - 'spec/support/page_objects/reset_memorable_word_page.rb' + +# Offense count: 2 +# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms. +# CheckDefinitionPathHierarchyRoots: lib, spec, test, src +# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS +Naming/FileName: + Exclude: + - 'import-secrets.rb' + - 'node_modules/et_gds_design_system/spec/support/capybara-screenshot.rb' + +# Offense count: 3 +# Configuration parameters: ForbiddenDelimiters. +# ForbiddenDelimiters: (?i-mx:(^|\s)(EO[A-Z]{1}|END)(\s|$)) +Naming/HeredocDelimiterNaming: + Exclude: + - 'node_modules/et_gds_design_system/install/template.rb' + - 'spec/support/gov_fake_notify.rb' + +# Offense count: 3 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyleForLeadingUnderscores. +# SupportedStylesForLeadingUnderscores: disallowed, required, optional +Naming/MemoizedInstanceVariableName: + Exclude: + - 'app/controllers/diversities_controller.rb' + - 'app/controllers/refunds_controller.rb' + - 'app/helpers/cookies_helper.rb' + +# Offense count: 2 +# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. +# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to +Naming/MethodParameterName: + Exclude: + - 'app/models/session.rb' + - 'app/services/multipart.rb' + +# Offense count: 9 +# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros. +# NamePrefix: is_, has_, have_ +# ForbiddenPrefixes: is_, has_, have_ +# AllowedMethods: is_a? +# MethodDefinitionMacros: define_method, define_singleton_method +Naming/PredicateName: + Exclude: + - 'app/forms/additional_claimants_upload_form.rb' + - 'app/forms/form.rb' + - 'app/forms/refunds/bank_details_form.rb' + - 'app/helpers/page_helper.rb' + - 'app/models/application_record.rb' + - 'app/models/refund.rb' + +# Offense count: 14 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: PreferredName. +Naming/RescuedExceptionsVariableName: + Exclude: + - 'spec/support/api_support/json_objects/v2/build_claim_details_file_json_object.rb' + - 'spec/support/api_support/json_objects/v2/build_claim_json_object.rb' + - 'spec/support/api_support/json_objects/v2/build_claimants_file_json_object.rb' + - 'spec/support/api_support/json_objects/v2/build_diversity_response_json_object.rb' + - 'spec/support/api_support/json_objects/v2/build_primary_claimant_json_object.rb' + - 'spec/support/api_support/json_objects/v2/build_primary_representative_json_object.rb' + - 'spec/support/api_support/json_objects/v2/build_primary_respondent_json_object.rb' + - 'spec/support/api_support/json_objects/v2/build_secondary_claimants_json_object.rb' + - 'spec/support/api_support/json_objects/v2/build_secondary_respondents_json_object.rb' + - 'spec/support/api_support/json_objects/v2/claimant_json_object.rb' + - 'spec/support/api_support/json_objects/v2/create_reference_json_object.rb' + - 'spec/support/api_support/json_objects/v2/primary_claimant_json_object.rb' + - 'spec/support/api_support/json_objects/v2/representative_json_object.rb' + - 'spec/support/api_support/json_objects/v2/respondent_json_object.rb' + +# Offense count: 4 +# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns. +# SupportedStyles: snake_case, normalcase, non_integer +# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64 +Naming/VariableNumber: + Exclude: + - 'spec/models/session_spec.rb' + - 'spec/support/refunds_steps/setup_steps.rb' + +# Offense count: 21 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: be, be_nil +RSpec/BeNil: + Exclude: + - 'spec/forms/additional_information_form_spec.rb' + - 'spec/forms/claim_type_form_spec.rb' + - 'spec/forms/claimant_form_spec.rb' + - 'spec/forms/employment_form_spec.rb' + - 'spec/forms/respondent_form_spec.rb' + - 'spec/support/shared_examples/date.rb' + +# Offense count: 136 +# Configuration parameters: Prefixes, AllowedPatterns. +# Prefixes: when, with, without +RSpec/ContextWording: + Enabled: false + +# Offense count: 21 +# Configuration parameters: IgnoredMetadata. +RSpec/DescribeClass: + Enabled: false + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +RSpec/EmptyLineAfterExampleGroup: + Exclude: + - 'spec/forms/employment_form_spec.rb' + - 'spec/support/shared_examples/google_tag_manager.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +RSpec/EmptyLineAfterFinalLet: + Exclude: + - 'spec/validators/special_character_validator_spec.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowConsecutiveOneLiners. +RSpec/EmptyLineAfterHook: + Exclude: + - 'spec/support/shared_examples/google_tag_manager.rb' + +# Offense count: 2 +# Configuration parameters: CountAsOne. +RSpec/ExampleLength: + Max: 13 + +# Offense count: 11 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: CustomTransform, IgnoredWords, DisallowedExamples. +# DisallowedExamples: works +RSpec/ExampleWording: + Exclude: + - 'spec/forms/claim_type_form_spec.rb' + - 'spec/support/shared_examples/date.rb' + - 'spec/validators/ccd_phone_validator_spec.rb' + +# Offense count: 3 +RSpec/ExpectInHook: + Exclude: + - 'spec/forms/refunds/review_form_spec.rb' + +# Offense count: 2 +# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly. +# Include: **/*_spec*rb*, **/spec/**/* +RSpec/FilePath: + Exclude: + - 'spec/services/carrierwave_filename_spec.rb' + - 'spec/types/et_date_spec.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: implicit, each, example +RSpec/HookArgument: + Exclude: + - 'spec/support/active_job.rb' + - 'spec/support/gov_fake_notify.rb' + +# Offense count: 8 +RSpec/LeakyConstantDeclaration: + Exclude: + - 'spec/types/et_date_spec.rb' + - 'spec/validators/additional_claimants_csv_validator_spec.rb' + - 'spec/validators/date_range_validator_spec.rb' + - 'spec/validators/date_validator_spec.rb' + - 'spec/validators/dx_string_validator_spec.rb' + - 'spec/validators/special_character_validator_spec.rb' + +# Offense count: 3 +RSpec/LetSetup: + Exclude: + - 'node_modules/et_gds_design_system/spec/features/govuk_file_dropzone_field_spec.rb' + +# Offense count: 33 +# Configuration parameters: EnforcedStyle. +# SupportedStyles: have_received, receive +RSpec/MessageSpies: + Exclude: + - 'spec/controllers/diversities_controller_spec.rb' + - 'spec/controllers/timeout_sessions_controller_spec.rb' + - 'spec/features/admin_panel/admin_show_feature_spec.rb' + - 'spec/forms/additional_claimants_form/additional_claimant_spec.rb' + - 'spec/forms/additional_claimants_upload_form_spec.rb' + - 'spec/forms/employment_form_spec.rb' + - 'spec/forms/refunds/review_form_spec.rb' + - 'spec/forms/representative_form_spec.rb' + - 'spec/models/claim_spec.rb' + - 'spec/models/diversity_spec.rb' + - 'spec/services/additional_claimants_csv/model_builder_spec.rb' + - 'spec/services/markdown_renderer_spec.rb' + - 'spec/support/shared_examples/address.rb' + - 'spec/support/shared_examples/form.rb' + +# Offense count: 5 +RSpec/MultipleExpectations: + Max: 4 + +# Offense count: 1 +# Configuration parameters: AllowSubject, Max. +RSpec/MultipleMemoizedHelpers: + Exclude: + - 'spec/features/terms_spec.rb' + +# Offense count: 7 +# Configuration parameters: EnforcedStyle, IgnoreSharedExamples. +# SupportedStyles: always, named_only +RSpec/NamedSubject: + Exclude: + - 'spec/forms/additional_claimants_form_spec.rb' + - 'spec/forms/additional_respondents_form_spec.rb' + - 'spec/services/submit_claim_to_api_service_spec.rb' + - 'spec/views/claim_reviews/show/review_page_claim_outcome_spec.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: not_to, to_not +RSpec/NotToNot: + Exclude: + - 'spec/forms/respondent_form_spec.rb' + +# Offense count: 2 +RSpec/PendingWithoutReason: + Exclude: + - 'spec/forms/additional_claimants_form_spec.rb' + +# Offense count: 3 +# This cop supports unsafe autocorrection (--autocorrect-all). +RSpec/Rails/TravelAround: + Exclude: + - 'spec/features/admin_panel/admin_show_feature_spec.rb' + - 'spec/features/create_claim_applications_spec.rb' + - 'spec/presenters/confirmation_presenter_spec.rb' + +# Offense count: 2 +RSpec/RepeatedDescription: + Exclude: + - 'spec/types/et_date_spec.rb' + +# Offense count: 2 +RSpec/RepeatedExample: + Exclude: + - 'spec/validators/ccd_personal_title_validator_spec.rb' + +# Offense count: 2 +RSpec/RepeatedExampleGroupDescription: + Exclude: + - 'spec/forms/respondent_form_spec.rb' + +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +RSpec/ScatteredSetup: + Exclude: + - 'spec/features/create_claim_applications_spec.rb' + - 'spec/forms/additional_claimants_upload_form_spec.rb' + +# Offense count: 17 +# This cop supports safe autocorrection (--autocorrect). +RSpec/SortMetadata: + Enabled: false + +# Offense count: 6 +RSpec/StubbedMock: + Exclude: + - 'spec/features/admin_panel/admin_show_feature_spec.rb' + - 'spec/forms/additional_claimants_form/additional_claimant_spec.rb' + - 'spec/forms/refunds/review_form_spec.rb' + - 'spec/models/claim_spec.rb' + +# Offense count: 6 +# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames. +RSpec/VerifiedDoubles: + Exclude: + - 'spec/forms/additional_claimants_form/additional_claimant_spec.rb' + - 'spec/forms/refunds/bank_details_form_spec.rb' + - 'spec/forms/refunds/confirmation_form_spec.rb' + - 'spec/forms/refunds/fees_form_spec.rb' + - 'spec/forms/refunds/profile_selection_form_spec.rb' + - 'spec/forms/refunds/review_form_spec.rb' + +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: ExpectedOrder, Include. +# ExpectedOrder: index, show, new, edit, create, update, destroy +# Include: app/controllers/**/*.rb +Rails/ActionOrder: + Exclude: + - 'app/controllers/claim_reviews_controller.rb' + - 'app/controllers/cookies_controller.rb' + - 'app/controllers/diversities_controller.rb' + - 'app/controllers/timeout_sessions_controller.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Rails/ApplicationRecord: + Exclude: + - 'node_modules/et_gds_design_system/test/dummy/app/models/kitchen_sink.rb' + +# Offense count: 12 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: NilOrEmpty, NotPresent, UnlessPresent. +Rails/Blank: + Exclude: + - 'app/views/api/claim/_build_primary_representative.json.jbuilder' + - 'spec/support/api_support/json_objects/v2/claimant_json_object.rb' + - 'spec/support/api_support/json_objects/v2/primary_claimant_json_object.rb' + - 'spec/support/api_support/json_objects/v2/representative_json_object.rb' + - 'spec/support/api_support/json_objects/v2/respondent_json_object.rb' + - 'spec/support/page_objects/additional_respondents_page.rb' + - 'spec/support/page_objects/group_claims_page.rb' + +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +Rails/CompactBlank: + Exclude: + - 'app/controllers/claim_reviews_controller.rb' + - 'app/validators/additional_claimants_csv_validator.rb' + +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle, AllowToTime. +# SupportedStyles: strict, flexible +Rails/Date: + Exclude: + - 'app/forms/employment_form.rb' + +# Offense count: 8 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforceForPrefixed. +Rails/Delegate: + Exclude: + - 'node_modules/et_gds_design_system/spec/support/page_objects/kitchen_sink_page.rb' + - 'spec/support/email_support/emails_sent.rb' + - 'spec/support/page_objects/base_page.rb' + - 'spec/support/page_objects/saving_your_claim_page.rb' + - 'spec/support/sections/checkbox_question_section.rb' + - 'spec/support/sections/text_area_question_section.rb' + - 'spec/support/sections/text_question_section.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: slashes, arguments +Rails/FilePath: + Exclude: + - 'config/application.rb' + - 'node_modules/et_gds_design_system/test/dummy/config/environments/development.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +Rails/FindById: + Exclude: + - 'app/forms/diversities/confirmation_form.rb' + - 'app/forms/refunds/confirmation_form.rb' + +# Offense count: 9 +# Configuration parameters: Include. +# Include: app/models/**/*.rb +Rails/HasManyOrHasOneDependent: + Exclude: + - 'app/models/claim.rb' + - 'app/models/claimant.rb' + - 'app/models/representative.rb' + - 'app/models/respondent.rb' + +# Offense count: 1 +# Configuration parameters: Include. +# Include: spec/**/*.rb, test/**/*.rb +Rails/I18nLocaleAssignment: + Exclude: + - 'spec/presenters/confirmation_presenter_spec.rb' + +# Offense count: 2 +Rails/I18nLocaleTexts: + Exclude: + - 'app/admin/claim.rb' + +# Offense count: 6 +# Configuration parameters: IgnoreScopes, Include. +# Include: app/models/**/*.rb +Rails/InverseOf: + Exclude: + - 'app/models/claim.rb' + - 'app/models/user.rb' + +# Offense count: 2 +# Configuration parameters: Include. +# Include: app/controllers/**/*.rb, app/mailers/**/*.rb +Rails/LexicallyScopedActionFilter: + Exclude: + - 'app/controllers/claims_controller.rb' + - 'app/controllers/save_and_return/sessions_controller.rb' + +# Offense count: 2 +Rails/OutputSafety: + Exclude: + - 'app/helpers/claim_reviews_helper.rb' + - 'app/services/markdown_renderer.rb' + +# Offense count: 3 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Include. +# Include: **/Rakefile, **/*.rake +Rails/RakeEnvironment: + Exclude: + - 'lib/tasks/test.rake' + - 'node_modules/et_gds_design_system/lib/tasks/et_gds_design_system_tasks.rake' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Include. +# Include: spec/**/*.rb, test/**/*.rb +Rails/RedundantTravelBack: + Exclude: + - 'spec/models/stats/claim_stats_spec.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: conservative, aggressive +Rails/ShortI18n: + Exclude: + - 'app/helpers/maintenance_notice_helper.rb' + +# Offense count: 2 +# Configuration parameters: ForbiddenMethods, AllowedMethods. +# ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all +Rails/SkipsModelValidations: + Exclude: + - 'app/models/claim.rb' + +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowOnlyRestArgument, UseAnonymousForwarding, RedundantRestArgumentNames, RedundantKeywordRestArgumentNames, RedundantBlockArgumentNames. +# RedundantRestArgumentNames: args, arguments +# RedundantKeywordRestArgumentNames: kwargs, options, opts +# RedundantBlockArgumentNames: blk, block, proc +Style/ArgumentsForwarding: + Exclude: + - 'app/forms/form_collection_proxy.rb' + - 'spec/support/page_object_helpers.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: percent_q, bare_percent +Style/BarePercentLiterals: + Exclude: + - 'spec/support/shared_contexts/with_controller_dependencies_for_reviews.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/BlockComments: + Exclude: + - 'node_modules/et_gds_design_system/spec/spec_helper.rb' + +# Offense count: 6 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: nested, compact +Style/ClassAndModuleChildren: + Exclude: + - 'app/services/additional_claimants_csv/base_csv.rb' + - 'app/services/additional_claimants_csv/claimant_collection.rb' + - 'app/services/additional_claimants_csv/error_conversion.rb' + - 'app/services/additional_claimants_csv/model_builder.rb' + - 'app/services/additional_claimants_csv/result.rb' + - 'node_modules/et_gds_design_system/test/et_gds_design_system_test.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: compact, expanded +Style/EmptyMethod: + Exclude: + - 'spec/support/page_objects/check_your_claim_page.rb' + - 'spec/support/page_objects/saving_your_claim_page.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/EvalWithLocation: + Exclude: + - 'spec/support/shared_contexts/with_controller_dependencies_for_reviews.rb' + +# Offense count: 15 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowedVars. +Style/FetchEnvVar: + Exclude: + - 'config/application.rb' + - 'config/environments/local.rb' + - 'config/environments/production.rb' + +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns. +# SupportedStyles: annotated, template, unannotated +# AllowedMethods: redirect +Style/FormatStringToken: + Exclude: + - 'app/services/multipart.rb' + +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/GlobalStdStream: + Exclude: + - 'config/environments/production.rb' + - 'node_modules/et_gds_design_system/test/dummy/config/environments/production.rb' + +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowSplatArgument. +Style/HashConversion: + Exclude: + - 'app/services/additional_claimants_csv/error_conversion.rb' + - 'app/services/additional_claimants_csv/model_builder.rb' + +# Offense count: 19 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. +# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys +# SupportedShorthandSyntax: always, never, either, consistent +Style/HashSyntax: + Exclude: + - 'lib/tasks/test.rake' + - 'spec/support/api_support/json_objects/v2/build_claim_json_object.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +Style/KeywordParametersOrder: + Exclude: + - 'spec/support/email_support/email_objects/reset_password_email_html.rb' + - 'spec/support/email_support/email_objects/reset_password_email_text.rb' + - 'spec/support/page_objects/saving_your_claim_page.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: line_count_dependent, lambda, literal +Style/Lambda: + Exclude: + - 'spec/support/et_test_helpers.rb' + +# Offense count: 3 +Style/MissingRespondToMissing: + Exclude: + - 'app/models/null_object.rb' + - 'app/models/session.rb' + - 'app/presenters/presenter.rb' + +# Offense count: 4 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: literals, strict +Style/MutableConstant: + Exclude: + - 'app/validators/dx_string_validator.rb' + - 'node_modules/et_gds_design_system/lib/et_gds_design_system/form/builder.rb' + - 'node_modules/et_gds_design_system/lib/et_gds_design_system/version.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowedMethods. +# AllowedMethods: be, be_a, be_an, be_between, be_falsey, be_kind_of, be_instance_of, be_truthy, be_within, eq, eql, end_with, include, match, raise_error, respond_to, start_with +Style/NestedParenthesizedCalls: + Exclude: + - 'spec/support/page_objects/additional_respondents_page.rb' + - 'spec/support/sections/radio_buttons_question_section.rb' + - 'spec/support/sections/select_question_section.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: PreferredDelimiters. +Style/PercentLiteralDelimiters: + Exclude: + - 'config/application.rb' + +# Offense count: 49 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: same_as_string_literals, single_quotes, double_quotes +Style/QuotedSymbols: + Exclude: + - 'spec/support/shared_examples/email_validation.rb' + - 'spec/validators/additional_claimants_csv_validator_spec.rb' + +# Offense count: 3 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Methods. +Style/RedundantArgument: + Exclude: + - 'spec/support/page_objects/step_seven_page.rb' + +# Offense count: 60 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantCurrentDirectoryInPath: + Enabled: false + +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: SafeForConstants. +Style/RedundantFetchBlock: + Exclude: + - 'node_modules/et_gds_design_system/test/dummy/config/puma.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantLineContinuation: + Exclude: + - 'app/presenters/confirmation_presenter.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantRegexpArgument: + Exclude: + - 'app/helpers/application_helper.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantRegexpEscape: + Exclude: + - 'spec/support/email_support/email_objects/reset_password_email_html.rb' + +# Offense count: 11 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, AllowInnerSlashes. +# SupportedStyles: slashes, percent_r, mixed +Style/RegexpLiteral: + Exclude: + - 'app/forms/refunds/bank_details_form.rb' + - 'app/helpers/application_helper.rb' + - 'spec/support/page_objects/about_the_claim_page.rb' + - 'spec/support/page_objects/group_claims_page.rb' + - 'spec/support/shared_contexts/fake_gov_notify.rb' + +# Offense count: 6 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: AllowedMethods, AllowedPatterns. +Style/ReturnNilInPredicateMethodDefinition: + Exclude: + - 'app/forms/employment_form.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: RequireEnglish, EnforcedStyle. +# SupportedStyles: use_perl_names, use_english_names, use_builtin_english_names +Style/SpecialGlobalVars: + Exclude: + - 'lib/tasks/test.rake' + +# Offense count: 9 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Mode. +Style/StringConcatenation: + Exclude: + - 'app/models/application_record.rb' + - 'spec/features/attaching_a_document_spec.rb' + - 'spec/forms/claim_details_form_spec.rb' + +# Offense count: 5 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyleForMultiline. +# SupportedStylesForMultiline: comma, consistent_comma, no_comma +Style/TrailingCommaInHashLiteral: + Exclude: + - 'spec/validators/dx_string_validator_spec.rb' + - 'spec/validators/special_character_validator_spec.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, MinSize, WordRegex. +# SupportedStyles: percent, brackets +Style/WordArray: + Exclude: + - 'config/application.rb' diff --git a/Gemfile b/Gemfile index fce2485b0..81223c071 100644 --- a/Gemfile +++ b/Gemfile @@ -57,9 +57,9 @@ group :development, :test do gem 'rspec-its', '~> 1.2', require: 'rspec/its' gem 'rspec-rails', '~> 6.0' gem 'rspec_junit_formatter', '~> 0.6.0' - gem 'rubocop', '~> 1.8', :require => false - gem 'rubocop-rails', require: false - gem 'rubocop-rspec', '~> 2.1', :require => false + gem 'rubocop', '~> 1.8', require: false + gem "rubocop-rails", "~> 2.17", require: false + gem 'rubocop-rspec', '~> 2.1', require: false gem 'shoulda-matchers', '~> 5.1' gem 'spring', '~> 4.0' gem 'parallel_tests', '~> 4.0' diff --git a/Gemfile.lock b/Gemfile.lock index fa0e9b25d..445a6106c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -622,7 +622,7 @@ DEPENDENCIES rspec-rails (~> 6.0) rspec_junit_formatter (~> 0.6.0) rubocop (~> 1.8) - rubocop-rails + rubocop-rails (~> 2.17) rubocop-rspec (~> 2.1) selenium-webdriver (~> 4.3, < 4.11) sentry-rails (~> 5.7) From 9fee075f1cb357d0369cb9cfa90be968de300e85 Mon Sep 17 00:00:00 2001 From: Aaron Lambley Date: Thu, 18 Jan 2024 11:06:24 +0000 Subject: [PATCH 2/2] run rubocop -a --- app/models/claim.rb | 3 ++- config/application.rb | 2 +- .../timeout_sessions_controller_spec.rb | 2 +- spec/factories.rb | 8 ++++---- .../admin_panel/admin_index_feature_spec.rb | 8 ++++---- .../admin_panel/admin_show_feature_spec.rb | 14 +++++++------- .../features/create_claim_applications_spec.rb | 2 +- .../multi_lang/claimant_validation_spec.rb | 2 +- .../representatives_details_validation_spec.rb | 2 +- .../respondents_details_validation_spec.rb | 2 +- spec/features/quick_edit_spec.rb | 2 +- .../additional_claimants_upload_form_spec.rb | 2 +- spec/models/claim_spec.rb | 4 ++-- spec/models/stats/claim_stats_spec.rb | 12 ++++++------ spec/presenters/confirmation_presenter_spec.rb | 6 +++--- spec/services/carrierwave_filename_spec.rb | 6 +++--- spec/services/et_api_spec.rb | 2 +- .../submit_claim_to_api_service_spec.rb | 2 -- ...t_diversity_response_to_api_service_spec.rb | 2 +- .../review_page_additional_information_spec.rb | 2 +- .../show/review_page_claim_details_spec.rb | 2 +- .../show/review_page_claim_outcome_spec.rb | 4 ++-- .../show/review_page_claim_type_spec.rb | 4 ++-- .../review_page_claimant_collection_spec.rb | 6 +++--- .../show/review_page_claimant_spec.rb | 8 ++++---- .../show/review_page_employment_spec.rb | 2 +- .../show/review_page_representative_spec.rb | 2 +- .../show/review_page_respondent_spec.rb | 18 +++++++++--------- 28 files changed, 65 insertions(+), 66 deletions(-) diff --git a/app/models/claim.rb b/app/models/claim.rb index 379ac7647..2d2dfd26f 100644 --- a/app/models/claim.rb +++ b/app/models/claim.rb @@ -3,7 +3,8 @@ class Claim < ApplicationRecord include ClaimLists def self.ransackable_associations(_auth_object = nil) - ['claimants', 'employment', 'events', 'office', 'primary_claimant', 'primary_respondent', 'representative', 'respondents', 'secondary_claimants', 'secondary_respondents', 'user'] + ['claimants', 'employment', 'events', 'office', 'primary_claimant', 'primary_respondent', 'representative', 'respondents', 'secondary_claimants', 'secondary_respondents', + 'user'] end has_one :user, foreign_key: :reference, primary_key: :application_reference, inverse_of: :claim, required: false diff --git a/config/application.rb b/config/application.rb index 3d3ad7c98..af3905ddd 100644 --- a/config/application.rb +++ b/config/application.rb @@ -26,7 +26,7 @@ class Application < Rails::Application # config.eager_load_paths << Rails.root.join("extras") # The default locale is :en and all translations from config/locales/**/*.rb,yml are auto loaded. - config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}').to_s] + config.i18n.load_path += Dir[Rails.root.join("config/locales/**/*.{rb,yml}").to_s] config.i18n.default_locale = :en # config.active_record.schema_format = :sql config.active_record.yaml_column_permitted_classes = [ActiveSupport::HashWithIndifferentAccess] diff --git a/spec/controllers/timeout_sessions_controller_spec.rb b/spec/controllers/timeout_sessions_controller_spec.rb index 71da71461..aee9bed84 100644 --- a/spec/controllers/timeout_sessions_controller_spec.rb +++ b/spec/controllers/timeout_sessions_controller_spec.rb @@ -28,7 +28,7 @@ end describe 'for email' do - let(:claim) { create :claim, email_address: nil } + let(:claim) { create(:claim, email_address: nil) } before do allow(user_session).to receive(:email_address).and_return(email) diff --git a/spec/factories.rb b/spec/factories.rb index cb6d16cec..7d8027c75 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -61,13 +61,13 @@ trait :null_primary_claimant do primary_claimant do - build :claimant, + build(:claimant, address_telephone_number: nil, mobile_number: nil, email_address: nil, fax_number: nil, contact_preference: nil, - gender: nil, date_of_birth: nil + gender: nil, date_of_birth: nil) end end @@ -90,11 +90,11 @@ trait :null_representative do representative do - build :representative, + build(:representative, address_telephone_number: nil, mobile_number: nil, email_address: nil, - dx_number: nil + dx_number: nil) end end diff --git a/spec/features/admin_panel/admin_index_feature_spec.rb b/spec/features/admin_panel/admin_index_feature_spec.rb index 1fd557dcc..14128be40 100644 --- a/spec/features/admin_panel/admin_index_feature_spec.rb +++ b/spec/features/admin_panel/admin_index_feature_spec.rb @@ -3,18 +3,18 @@ RSpec.describe 'Viewing the admin interfaces index page', type: :feature do let(:out_of_filter_range_claim) do - create :claim, + create(:claim, submitted_at: Date.new(2015, 6, 1), - created_at: Date.new(2015, 6, 1) + created_at: Date.new(2015, 6, 1)) end let(:claim) do - create :claim, + create(:claim, application_reference: 'SUCH-9999', fee_group_reference: '511234567800', submitted_at: Date.new(2015, 6, 5), # Set created_at to a later date than other models to ensure it's the first row. - created_at: Date.new(2015, 6, 5) + created_at: Date.new(2015, 6, 5)) end before do diff --git a/spec/features/admin_panel/admin_show_feature_spec.rb b/spec/features/admin_panel/admin_show_feature_spec.rb index ec6f035d4..db7b967d5 100644 --- a/spec/features/admin_panel/admin_show_feature_spec.rb +++ b/spec/features/admin_panel/admin_show_feature_spec.rb @@ -2,15 +2,15 @@ RSpec.describe 'Viewing a claims details in the admin interface', type: :feature do let!(:claim_with_attachments) do - create :claim, :submitted, :with_pdf, + create(:claim, :submitted, :with_pdf, fee_group_reference: '511234567800', - confirmation_email_recipients: ['such@lolz.com', 'wow@lol.biz'] + confirmation_email_recipients: ['such@lolz.com', 'wow@lol.biz']) end let!(:enqueued_claim) do - create :claim, :with_pdf, + create(:claim, :with_pdf, fee_group_reference: '511234567800', - confirmation_email_recipients: ['such@lolz.com', 'wow@lol.biz'] + confirmation_email_recipients: ['such@lolz.com', 'wow@lol.biz']) end context 'with time frozen' do @@ -78,11 +78,11 @@ context 'claim without large text inputs' do let!(:claim_without_large_text_inputs) do - create :claim, + create(:claim, claim_details: nil, miscellaneous_information: nil, other_claim_details: nil, - other_outcome: nil + other_outcome: nil) end before { visit admin_claim_path claim_without_large_text_inputs.reference } @@ -105,7 +105,7 @@ end context 'claim without attachments' do - let!(:claim_without_attachments) { create :claim, :no_attachments } + let!(:claim_without_attachments) { create(:claim, :no_attachments) } before { visit admin_claim_path claim_without_attachments.reference } diff --git a/spec/features/create_claim_applications_spec.rb b/spec/features/create_claim_applications_spec.rb index 88e66c4d1..a5115f061 100644 --- a/spec/features/create_claim_applications_spec.rb +++ b/spec/features/create_claim_applications_spec.rb @@ -1,6 +1,6 @@ require 'rails_helper' -describe 'Claim applications', type: :feature, js: true do +describe 'Claim applications', js: true, type: :feature do include FormMethods include Messages include MailMatchers diff --git a/spec/features/multi_lang/claimant_validation_spec.rb b/spec/features/multi_lang/claimant_validation_spec.rb index ce1248dda..797dbe7c0 100644 --- a/spec/features/multi_lang/claimant_validation_spec.rb +++ b/spec/features/multi_lang/claimant_validation_spec.rb @@ -1,5 +1,5 @@ require 'rails_helper' -RSpec.describe 'Claimant Validation', type: :feature, js: true do +RSpec.describe 'Claimant Validation', js: true, type: :feature do it 'filters out an incorrect phone number and provides the correct message' do # Arrange - get to the page loaded with a claimant with the phone number overridden claimant = build(:ui_claimant, :mandatory, phone_or_mobile_number: 'somethingwromg', alternative_phone_or_mobile_number: 'something_wrong') diff --git a/spec/features/multi_lang/representatives_details_validation_spec.rb b/spec/features/multi_lang/representatives_details_validation_spec.rb index 6023e2a33..54132df12 100644 --- a/spec/features/multi_lang/representatives_details_validation_spec.rb +++ b/spec/features/multi_lang/representatives_details_validation_spec.rb @@ -1,5 +1,5 @@ require 'rails_helper' -RSpec.describe 'Representatives Details Validation', type: :feature, js: true do +RSpec.describe 'Representatives Details Validation', js: true, type: :feature do it 'filters out an incorrect phone number and provides the correct message' do # Arrange - get to the page loaded with a claimant with the phone number overridden claimant = build(:ui_claimant, :mandatory) diff --git a/spec/features/multi_lang/respondents_details_validation_spec.rb b/spec/features/multi_lang/respondents_details_validation_spec.rb index 320a2db79..b951d1373 100644 --- a/spec/features/multi_lang/respondents_details_validation_spec.rb +++ b/spec/features/multi_lang/respondents_details_validation_spec.rb @@ -1,5 +1,5 @@ require 'rails_helper' -RSpec.describe 'Respondents Details Validation', type: :feature, js: true do +RSpec.describe 'Respondents Details Validation', js: true, type: :feature do it 'filters out an incorrect phone number and provides the correct message' do # Arrange - get to the page loaded with a claimant with the phone number overridden claimant = build(:ui_claimant, :mandatory) diff --git a/spec/features/quick_edit_spec.rb b/spec/features/quick_edit_spec.rb index 811e019c3..632938d28 100644 --- a/spec/features/quick_edit_spec.rb +++ b/spec/features/quick_edit_spec.rb @@ -3,7 +3,7 @@ describe 'Quick edit' do include FormMethods - let(:claim_ready_for_review) { create :claim, :no_attachments, state: 'created' } + let(:claim_ready_for_review) { create(:claim, :no_attachments, state: 'created') } before do fill_in_return_form claim_ready_for_review.reference, 'lollolol' diff --git a/spec/forms/additional_claimants_upload_form_spec.rb b/spec/forms/additional_claimants_upload_form_spec.rb index 22f6680ec..e72bb4da4 100644 --- a/spec/forms/additional_claimants_upload_form_spec.rb +++ b/spec/forms/additional_claimants_upload_form_spec.rb @@ -4,7 +4,7 @@ let(:additional_claimants_upload_form) { described_class.new(resource) } - let(:resource) { create :claim, :no_attachments } + let(:resource) { create(:claim, :no_attachments) } let(:path) { Rails.root.join('spec/support/files').to_s } let(:file) { { 'path' => path, 'filename' => 'test.csv', 'content_type' => 'application/csv' } } diff --git a/spec/models/claim_spec.rb b/spec/models/claim_spec.rb index 5f8434258..88e3481b2 100644 --- a/spec/models/claim_spec.rb +++ b/spec/models/claim_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' RSpec.describe Claim, type: [:claim, :model] do - let(:claim_enqueued) { create :claim } + let(:claim_enqueued) { create(:claim) } let(:claim) { described_class.create } it { is_expected.to have_secure_password } @@ -129,7 +129,7 @@ end context 'claim with a single claimant' do - let(:claim) { create :claim, :single_claimant } + let(:claim) { create(:claim, :single_claimant) } specify { expect(claim).not_to be_multiple_claimants } end diff --git a/spec/models/stats/claim_stats_spec.rb b/spec/models/stats/claim_stats_spec.rb index 9941bc4ad..252be99b2 100644 --- a/spec/models/stats/claim_stats_spec.rb +++ b/spec/models/stats/claim_stats_spec.rb @@ -17,12 +17,12 @@ after { travel_back } let(:current_time) { Time.zone.parse("2010-01-27 13:56:25") } - let(:started_claim) { create :claim, :not_submitted } - let(:old_started_claim) { create :claim, :not_submitted, created_at: 91.days.ago } - let(:old_out_of_range_started_claim) { create :claim, :not_submitted, created_at: 92.days.ago } - let(:completed_claim) { create :claim, :submitted } - let(:old_completed_claim) { create :claim, :submitted, created_at: 91.days.ago } - let(:old_out_of_range_completed_claim) { create :claim, :submitted, created_at: 92.days.ago } + let(:started_claim) { create(:claim, :not_submitted) } + let(:old_started_claim) { create(:claim, :not_submitted, created_at: 91.days.ago) } + let(:old_out_of_range_started_claim) { create(:claim, :not_submitted, created_at: 92.days.ago) } + let(:completed_claim) { create(:claim, :submitted) } + let(:old_completed_claim) { create(:claim, :submitted, created_at: 91.days.ago) } + let(:old_out_of_range_completed_claim) { create(:claim, :submitted, created_at: 92.days.ago) } let(:not_started_claim) { Claim.create } describe '.started_within_max_submission_timeframe' do diff --git a/spec/presenters/confirmation_presenter_spec.rb b/spec/presenters/confirmation_presenter_spec.rb index b1b8d8509..312ee7ec8 100644 --- a/spec/presenters/confirmation_presenter_spec.rb +++ b/spec/presenters/confirmation_presenter_spec.rb @@ -3,7 +3,7 @@ RSpec.describe ConfirmationPresenter, type: :presenter do let(:confirmation_presenter) { described_class.new claim } - let(:claim) { create :claim } + let(:claim) { create(:claim) } around do |example| travel_to(Time.new(2014).utc) { example.run } @@ -52,7 +52,7 @@ end context 'when there is no associated fee office' do - let(:claim) { create :claim, :no_fee_group_reference } + let(:claim) { create(:claim, :no_fee_group_reference) } it 'is the submission date' do expect(confirmation_presenter.submission_information). @@ -72,7 +72,7 @@ end context 'when no attachments were uploaded' do - let(:claim) { create :claim, :no_attachments } + let(:claim) { create(:claim, :no_attachments) } it 'yields text to state no attachments are present' do expect { |b| confirmation_presenter.each_item(&b) }. diff --git a/spec/services/carrierwave_filename_spec.rb b/spec/services/carrierwave_filename_spec.rb index 1ec3b9b7a..9d30a9df4 100644 --- a/spec/services/carrierwave_filename_spec.rb +++ b/spec/services/carrierwave_filename_spec.rb @@ -5,14 +5,14 @@ let(:claimants_csv) { claim.additional_claimants_csv } context 'attachment exists' do - let(:claim) { create :claim } + let(:claim) { create(:claim) } it 'returns the filename including the extension' do expect(described_class.for(claimants_csv)).to eq 'file.csv' end context 'handling filenames with non alphanumeric characters' do - let(:claim) { create :claim, :non_sanitized_attachment_filenames } + let(:claim) { create(:claim, :non_sanitized_attachment_filenames) } context 'when underscore = true' do it 'returns the filename with underscores' do @@ -29,7 +29,7 @@ end context 'attachment does not exist' do - let(:claim) { create :claim, :without_additional_claimants_csv } + let(:claim) { create(:claim, :without_additional_claimants_csv) } it 'returns nil' do expect(described_class.for(claimants_csv)).to be_nil diff --git a/spec/services/et_api_spec.rb b/spec/services/et_api_spec.rb index 91f40184a..b545655bf 100644 --- a/spec/services/et_api_spec.rb +++ b/spec/services/et_api_spec.rb @@ -18,7 +18,7 @@ let(:mock_submit_diversity_service) { class_spy('SubmitDiversityResponseToApiService', call: mock_submit_diversity_service_instance) } let(:mock_submit_diversity_service_instance) { instance_spy('SubmitDiversityResponseToApiService', valid?: true, errors: []) } - let(:example_diversity_response) { create :diversity } + let(:example_diversity_response) { create(:diversity) } it 'delegates to SubmitClaimToApiService' do expect(service).to be mock_submit_diversity_service_instance diff --git a/spec/services/submit_claim_to_api_service_spec.rb b/spec/services/submit_claim_to_api_service_spec.rb index 1c6edf4cb..ab9e02af9 100644 --- a/spec/services/submit_claim_to_api_service_spec.rb +++ b/spec/services/submit_claim_to_api_service_spec.rb @@ -1,4 +1,3 @@ -# rubocop:disable RSpec/MultipleExpectations require 'rails_helper' RSpec.describe SubmitClaimToApiService, type: :service do @@ -336,4 +335,3 @@ end end end -# rubocop:enable RSpec/MultipleExpectations diff --git a/spec/services/submit_diversity_response_to_api_service_spec.rb b/spec/services/submit_diversity_response_to_api_service_spec.rb index c13cbc7f8..4e9a5cd5a 100644 --- a/spec/services/submit_diversity_response_to_api_service_spec.rb +++ b/spec/services/submit_diversity_response_to_api_service_spec.rb @@ -69,7 +69,7 @@ include_context 'with build diversity response endpoint recording' include_context 'with command matcher' context 'typical data set' do - let(:example_diversity_response) { create :diversity } + let(:example_diversity_response) { create(:diversity) } include_context 'with action performed before each example' it { is_expected.to be_a_valid_api_command('BuildDiversityResponse').version(2).for_db_data(example_diversity_response) } diff --git a/spec/views/claim_reviews/show/review_page_additional_information_spec.rb b/spec/views/claim_reviews/show/review_page_additional_information_spec.rb index 62c2c84df..ded794e59 100644 --- a/spec/views/claim_reviews/show/review_page_additional_information_spec.rb +++ b/spec/views/claim_reviews/show/review_page_additional_information_spec.rb @@ -8,7 +8,7 @@ end let(:null_object) { NullObject.new } - let(:claim) { build_stubbed :claim, miscellaneous_information: "hey\r\nhey" } + let(:claim) { build_stubbed(:claim, miscellaneous_information: "hey\r\nhey") } before do view.singleton_class.class_eval do diff --git a/spec/views/claim_reviews/show/review_page_claim_details_spec.rb b/spec/views/claim_reviews/show/review_page_claim_details_spec.rb index 3c345e8d5..f4ce5dfe1 100644 --- a/spec/views/claim_reviews/show/review_page_claim_details_spec.rb +++ b/spec/views/claim_reviews/show/review_page_claim_details_spec.rb @@ -7,7 +7,7 @@ ET1::Test::ReviewPage.new end let(:claim) do - create :claim, claim_details: "wut\r\nwut", other_known_claimants: true, other_known_claimant_names: "Johnny Wishbone\r\nSamuel Pepys" + create(:claim, claim_details: "wut\r\nwut", other_known_claimants: true, other_known_claimant_names: "Johnny Wishbone\r\nSamuel Pepys") end let(:null_object) { NullObject.new } diff --git a/spec/views/claim_reviews/show/review_page_claim_outcome_spec.rb b/spec/views/claim_reviews/show/review_page_claim_outcome_spec.rb index 2731da1fd..13f4f548e 100644 --- a/spec/views/claim_reviews/show/review_page_claim_outcome_spec.rb +++ b/spec/views/claim_reviews/show/review_page_claim_outcome_spec.rb @@ -7,8 +7,8 @@ ET1::Test::ReviewPage.new end let(:claim) do - create :claim, desired_outcomes: [:tribunal_recommendation, :new_employment_and_compensation], - other_outcome: "25 bags\r\nyour job" + create(:claim, desired_outcomes: [:tribunal_recommendation, :new_employment_and_compensation], + other_outcome: "25 bags\r\nyour job") end let(:null_object) { NullObject.new } diff --git a/spec/views/claim_reviews/show/review_page_claim_type_spec.rb b/spec/views/claim_reviews/show/review_page_claim_type_spec.rb index bdc9976af..91126893e 100644 --- a/spec/views/claim_reviews/show/review_page_claim_type_spec.rb +++ b/spec/views/claim_reviews/show/review_page_claim_type_spec.rb @@ -8,11 +8,11 @@ end let(:claim_type_section) { review_page.claim_type_section } let(:claim) do - create :claim, + create(:claim, is_unfair_dismissal: true, discrimination_claims: [:sex_including_equal_pay, :race, :sexual_orientation], pay_claims: [:redundancy, :other], other_claim_details: "yo\r\nyo", - is_whistleblowing: true, send_claim_to_whistleblowing_entity: false + is_whistleblowing: true, send_claim_to_whistleblowing_entity: false) end let(:null_object) { NullObject.new } diff --git a/spec/views/claim_reviews/show/review_page_claimant_collection_spec.rb b/spec/views/claim_reviews/show/review_page_claimant_collection_spec.rb index ae8a9a158..8c2585c12 100644 --- a/spec/views/claim_reviews/show/review_page_claimant_collection_spec.rb +++ b/spec/views/claim_reviews/show/review_page_claimant_collection_spec.rb @@ -10,7 +10,7 @@ let(:null_object) { NullObject.new } let(:claimant_collection_section) { review_page.group_claim } - let(:claim) { create :claim } + let(:claim) { create(:claim) } before do view.singleton_class.class_eval do @@ -50,7 +50,7 @@ def claim_path_for(*) end context 'with secondary claimants' do - let(:claim) { create :claim, :without_additional_claimants_csv, :with_secondary_claimants } + let(:claim) { create(:claim, :without_additional_claimants_csv, :with_secondary_claimants) } it 'presents the list of claimants' do expect(claimant_collection_section.claimants[0]).to be_valid_for_model(claim.secondary_claimants[0]) @@ -58,7 +58,7 @@ def claim_path_for(*) end context 'without secondary claimants' do - let(:claim) { create :claim, :single_claimant } + let(:claim) { create(:claim, :single_claimant) } it 'returns "No"' do expect(claimant_collection_section.group_claim.answer).to have_text 'No' diff --git a/spec/views/claim_reviews/show/review_page_claimant_spec.rb b/spec/views/claim_reviews/show/review_page_claimant_spec.rb index 31626787c..8a6d3d3ef 100644 --- a/spec/views/claim_reviews/show/review_page_claimant_spec.rb +++ b/spec/views/claim_reviews/show/review_page_claimant_spec.rb @@ -8,14 +8,14 @@ end let(:claimant_section) { review_page.claimant_section } let(:claimant) do - build :claimant, + build(:claimant, title: 'Mr', first_name: 'Stevie', last_name: 'Graham', gender: 'male', date_of_birth: Date.civil(1999, 1, 15), address_building: '1', address_street: 'Lol street', address_locality: 'Lolzville', address_county: 'Lolzfordshire', address_post_code: 'LOL B1Z', address_telephone_number: '01234567890', mobile_number: '07956123456', email_address: 'joe@example.com', contact_preference: 'post', - special_needs: false, primary_claimant: true + special_needs: false, primary_claimant: true) end let(:claim) { create(:claim, primary_claimant: claimant) } @@ -64,14 +64,14 @@ def claim_path_for(*) describe '#is_disabled' do context 'when the claimant is disabled' do let(:claimant) do - build :claimant, + build(:claimant, title: 'Mr', first_name: 'Stevie', last_name: 'Graham', gender: 'male', date_of_birth: Date.civil(1999, 1, 15), address_building: '1', address_street: 'Lol street', address_locality: 'Lolzville', address_county: 'Lolzfordshire', address_post_code: 'LOL B1Z', address_telephone_number: '01234567890', mobile_number: '07956123456', email_address: 'joe@example.com', contact_preference: 'post', - has_special_needs: true, primary_claimant: true + has_special_needs: true, primary_claimant: true) end specify { expect(claimant_section.assistance_required.answer).to have_text('Yes') } diff --git a/spec/views/claim_reviews/show/review_page_employment_spec.rb b/spec/views/claim_reviews/show/review_page_employment_spec.rb index a5fd880cd..4a20469b0 100644 --- a/spec/views/claim_reviews/show/review_page_employment_spec.rb +++ b/spec/views/claim_reviews/show/review_page_employment_spec.rb @@ -8,7 +8,7 @@ end let(:employment_section) { review_page.employment_section } let(:employment) do - build :employment, default_employment_attributes.merge(employment_attributes) + build(:employment, default_employment_attributes.merge(employment_attributes)) end let(:employment_attributes) { {} } let(:default_employment_attributes) do diff --git a/spec/views/claim_reviews/show/review_page_representative_spec.rb b/spec/views/claim_reviews/show/review_page_representative_spec.rb index d6e5a1022..e6fb779c9 100644 --- a/spec/views/claim_reviews/show/review_page_representative_spec.rb +++ b/spec/views/claim_reviews/show/review_page_representative_spec.rb @@ -15,7 +15,7 @@ address_post_code: 'LOL B1Z', address_telephone_number: '01234567890', mobile_number: '07956123456', contact_preference: 'post', dx_number: '1' end - let(:claim) { create :claim, representative: representative } + let(:claim) { create(:claim, representative: representative) } let(:null_object) { NullObject.new } diff --git a/spec/views/claim_reviews/show/review_page_respondent_spec.rb b/spec/views/claim_reviews/show/review_page_respondent_spec.rb index 20b955de4..def801237 100644 --- a/spec/views/claim_reviews/show/review_page_respondent_spec.rb +++ b/spec/views/claim_reviews/show/review_page_respondent_spec.rb @@ -8,14 +8,14 @@ end let(:respondent_section) { review_page.respondent_section } let(:respondent) do - build :respondent, name: 'Lol Corp', address_building: '1', address_street: 'Lol street', + build(:respondent, name: 'Lol Corp', address_building: '1', address_street: 'Lol street', address_locality: 'Lolzville', address_county: 'Lolzfordshire', address_post_code: 'LOL B1Z', address_telephone_number: '01234567890', acas_early_conciliation_certificate_number: '123', no_acas_number_reason: :acas_has_no_jurisdiction, - primary_respondent: true + primary_respondent: true) end - let(:claim) { build_stubbed :claim, primary_respondent: respondent } + let(:claim) { build_stubbed(:claim, primary_respondent: respondent) } let(:null_object) { NullObject.new } @@ -53,12 +53,12 @@ def claim_path_for(*) context 'when target.acas_number_reason is nil' do let(:respondent) do - build :respondent, name: 'Lol Corp', address_building: '1', address_street: 'Lol street', + build(:respondent, name: 'Lol Corp', address_building: '1', address_street: 'Lol street', address_locality: 'Lolzville', address_county: 'Lolzfordshire', address_post_code: 'LOL B1Z', address_telephone_number: '01234567890', acas_early_conciliation_certificate_number: '', no_acas_number_reason: :acas_has_no_jurisdiction, - primary_respondent: true + primary_respondent: true) end it { expect(respondent_section.acas_number.answer).to have_text("Acas doesn’t have the power to conciliate on some or all of my claim") } @@ -67,12 +67,12 @@ def claim_path_for(*) context 'when worked at a different address' do let(:respondent) do - build :respondent, :without_work_address, name: 'Lol Corp', address_building: '1', address_street: 'Lol street', + build(:respondent, :without_work_address, name: 'Lol Corp', address_building: '1', address_street: 'Lol street', address_locality: 'Lolzville', address_county: 'Lolzfordshire', address_post_code: 'LOL B1Z', address_telephone_number: '01234567890', acas_early_conciliation_certificate_number: '123', no_acas_number_reason: :acas_has_no_jurisdiction, - primary_respondent: true, worked_at_same_address: false + primary_respondent: true, worked_at_same_address: false) end it 'includes work_address' do @@ -82,12 +82,12 @@ def claim_path_for(*) context 'when worked at same address' do let(:respondent) do - build :respondent, name: 'Lol Corp', address_building: '1', address_street: 'Lol street', + build(:respondent, name: 'Lol Corp', address_building: '1', address_street: 'Lol street', address_locality: 'Lolzville', address_county: 'Lolzfordshire', address_post_code: 'LOL B1Z', address_telephone_number: '01234567890', acas_early_conciliation_certificate_number: '123', no_acas_number_reason: :acas_has_no_jurisdiction, - primary_respondent: true, worked_at_same_address: true + primary_respondent: true, worked_at_same_address: true) end it 'does not include work_address' do