Skip to content

Commit

Permalink
Disable Rails/SkipsModelValidations in spec folder
Browse files Browse the repository at this point in the history
It's okay to skip model validation to setup a spec.
  • Loading branch information
JDutil committed Oct 24, 2019
1 parent 448c59a commit 1ce1e4e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions core/spec/models/spree/order_updater_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1ce1e4e

Please sign in to comment.