diff --git a/.rubocop.yml b/.rubocop.yml index fe9732d399f..46f788e278a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -121,6 +121,11 @@ Rails/DynamicFindBy: - find_by_param - find_by_param! +# It's okay to skip model validations to setup a spec. +Rails/SkipsModelValidations: + Exclude: + - '*/spec/**/*' + # We use a lot of # # expect { diff --git a/core/spec/models/spree/order_updater_spec.rb b/core/spec/models/spree/order_updater_spec.rb index 47cb2cf5d20..412f8c268db 100644 --- a/core/spec/models/spree/order_updater_spec.rb +++ b/core/spec/models/spree/order_updater_spec.rb @@ -158,7 +158,10 @@ def create_adjustment(label, amount) amount: -500, finalized: true, label: 'Some other credit') + + # rubocop:disable Rails/SkipsModelValidations line_item.adjustments.each { |item| item.update_column(:eligible, true) } + # rubocop:enable Rails/SkipsModelValidations order.recalculate