diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index ecd4013624..416d321c04 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1241,15 +1241,6 @@ Style/GuardClause: - 'spec/support/request/distribution_helper.rb' - 'spec/support/request/shop_workflow.rb' -# Offense count: 66 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. -# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys -Style/HashSyntax: - Exclude: - - 'spec/factories/stock_location_factory.rb' - - 'spec/models/spree/credit_card_spec.rb' - # Offense count: 2 Style/MissingRespondToMissing: Exclude: diff --git a/spec/factories/stock_location_factory.rb b/spec/factories/stock_location_factory.rb index 36b748dbec..0193a40281 100644 --- a/spec/factories/stock_location_factory.rb +++ b/spec/factories/stock_location_factory.rb @@ -26,8 +26,8 @@ FactoryBot.define do product_1 = create(:product) product_2 = create(:product) - stock_location.stock_items.where(:variant_id => product_1.master.id).first.adjust_count_on_hand(10) - stock_location.stock_items.where(:variant_id => product_2.master.id).first.adjust_count_on_hand(20) + stock_location.stock_items.where(variant_id: product_1.master.id).first.adjust_count_on_hand(10) + stock_location.stock_items.where(variant_id: product_2.master.id).first.adjust_count_on_hand(20) end end end diff --git a/spec/models/spree/credit_card_spec.rb b/spec/models/spree/credit_card_spec.rb index 38e9701e6f..769faa1439 100644 --- a/spec/models/spree/credit_card_spec.rb +++ b/spec/models/spree/credit_card_spec.rb @@ -31,8 +31,8 @@ module Spree it "should be true if payment is checkout" do payment = build_stubbed(:payment, created_at: Time.zone.now) - allow(payment).to receive_messages :pending? => false, - :checkout? => true + allow(payment).to receive_messages pending?: false, + checkout?: true expect(credit_card.can_capture?(payment)).to be_truthy end end @@ -54,16 +54,16 @@ module Spree it "should be false when order payment_state is not 'credit_owed'" do payment = build_stubbed(:payment, - order: create(:order, payment_state: 'paid')) + order: create(:order, payment_state: 'paid')) allow(payment).to receive(:completed?) { true } expect(credit_card.can_credit?(payment)).to be_falsy end it "should be false when credit_allowed is zero" do payment = build_stubbed(:payment, - order: create(:order, payment_state: 'credit_owed')) - allow(payment).to receive_messages :completed? => true, - :credit_allowed => 0 + order: create(:order, payment_state: 'credit_owed')) + allow(payment).to receive_messages completed?: true, + credit_allowed: 0 expect(credit_card.can_credit?(payment)).to be_falsy end