diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 5196330f3f..28e32673a1 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -39,24 +39,6 @@ Lint/FloatComparison: Exclude: - 'app/models/spree/gateway/pay_pal_express.rb' -# Offense count: 1 -Lint/IneffectiveAccessModifier: - Exclude: - - 'app/models/spree/user.rb' - -# Offense count: 1 -Lint/NoReturnInBeginEndBlocks: - Exclude: - - 'app/controllers/payment_gateways/stripe_controller.rb' - -# Offense count: 3 -# This cop supports unsafe autocorrection (--autocorrect-all). -Lint/RedundantDirGlobSort: - Exclude: - - 'engines/catalog/spec/spec_helper.rb' - - 'engines/dfc_provider/spec/spec_helper.rb' - - 'spec/system_helper.rb' - # Offense count: 24 # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max. Metrics/AbcSize: diff --git a/app/controllers/payment_gateways/stripe_controller.rb b/app/controllers/payment_gateways/stripe_controller.rb index ff88831324..37167a636d 100644 --- a/app/controllers/payment_gateways/stripe_controller.rb +++ b/app/controllers/payment_gateways/stripe_controller.rb @@ -68,11 +68,8 @@ module PaymentGateways end def valid_payment_intent? - @valid_payment_intent ||= begin - return false unless params["payment_intent"]&.starts_with?("pi_") - - order_and_payment_valid? - end + @valid_payment_intent ||= params["payment_intent"]&.starts_with?("pi_") && + order_and_payment_valid? end def order_and_payment_valid? diff --git a/app/models/spree/user.rb b/app/models/spree/user.rb index 72f2a3c80a..0bbe9d60f2 100644 --- a/app/models/spree/user.rb +++ b/app/models/spree/user.rb @@ -164,11 +164,6 @@ module Spree self.login ||= email if email end - # Generate a friendly string randomically to be used as token. - def self.friendly_token - SecureRandom.base64(15).tr('+/=', '-_ ').strip.delete("\n") - end - def limit_owned_enterprises return unless owned_enterprises.size > enterprise_limit diff --git a/engines/catalog/spec/spec_helper.rb b/engines/catalog/spec/spec_helper.rb index f6b5d7710e..183f65d422 100644 --- a/engines/catalog/spec/spec_helper.rb +++ b/engines/catalog/spec/spec_helper.rb @@ -1,5 +1,3 @@ # frozen_string_literal: true require '../../spec/spec_helper' - -Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].sort.each { |f| require f } diff --git a/engines/dfc_provider/spec/spec_helper.rb b/engines/dfc_provider/spec/spec_helper.rb index 3e363b392e..9ddcac95d1 100644 --- a/engines/dfc_provider/spec/spec_helper.rb +++ b/engines/dfc_provider/spec/spec_helper.rb @@ -2,7 +2,7 @@ require_relative '../../../spec/spec_helper' -Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].sort.each { |f| require f } +Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } RSpec.configure do |config| config.include AuthorizationHelper, type: :request diff --git a/spec/system_helper.rb b/spec/system_helper.rb index 4af20f4f56..2acb7f6534 100644 --- a/spec/system_helper.rb +++ b/spec/system_helper.rb @@ -3,4 +3,4 @@ require "base_spec_helper" # system/support/ files contain system tests configurations and helpers -Dir[File.join(__dir__, "system/support/**/*.rb")].sort.each { |file| require file } +Dir[File.join(__dir__, "system/support/**/*.rb")].each { |file| require file }