From 24e59a9cea0dcd551e9a713f4ab3a4263443edbf Mon Sep 17 00:00:00 2001 From: JDutil Date: Thu, 24 Oct 2019 11:53:36 -0600 Subject: [PATCH] Disable Rails/SkipsModelValidations in spec folder It's okay to skip model validation to setup a spec. --- .rubocop.yml | 5 +++++ core/spec/models/spree/order_updater_spec.rb | 1 + 2 files changed, 6 insertions(+) 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..147bf48acfb 100644 --- a/core/spec/models/spree/order_updater_spec.rb +++ b/core/spec/models/spree/order_updater_spec.rb @@ -158,6 +158,7 @@ def create_adjustment(label, amount) amount: -500, finalized: true, label: 'Some other credit') + line_item.adjustments.each { |item| item.update_column(:eligible, true) } order.recalculate