mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-11 18:26:50 +00:00
Fixes some rubocop linting offenses - part II
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -68,11 +68,11 @@ 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 ||= if params["payment_intent"]&.starts_with?("pi_")
|
||||
order_and_payment_valid?
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def order_and_payment_valid?
|
||||
|
||||
@@ -168,6 +168,7 @@ module Spree
|
||||
def self.friendly_token
|
||||
SecureRandom.base64(15).tr('+/=', '-_ ').strip.delete("\n")
|
||||
end
|
||||
private_class_method :friendly_token
|
||||
|
||||
def limit_owned_enterprises
|
||||
return unless owned_enterprises.size > enterprise_limit
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require '../../spec/spec_helper'
|
||||
|
||||
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].sort.each { |f| require f }
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user