diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index b7fa6eacda..aa12b8a9a5 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -937,20 +937,6 @@ Style/RedundantInterpolation: - 'lib/tasks/karma.rake' - 'spec/base_spec_helper.rb' -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Style/RedundantSelf: - Exclude: - - 'app/models/spree/order.rb' - -# Offense count: 4 -# This cop supports safe autocorrection (--autocorrect). -Style/RedundantStringEscape: - Exclude: - - 'app/models/spree/calculator.rb' - - 'spec/controllers/spree/admin/shipping_methods_controller_spec.rb' - - 'spec/system/admin/enterprise_fees_spec.rb' - # Offense count: 19 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AllowedMethods, AllowedPatterns. diff --git a/app/models/spree/calculator.rb b/app/models/spree/calculator.rb index 1b561d2549..9ff0e53651 100644 --- a/app/models/spree/calculator.rb +++ b/app/models/spree/calculator.rb @@ -28,7 +28,7 @@ module Spree end def to_s - self.class.name.titleize.gsub("Calculator\/", "") + self.class.name.titleize.gsub("Calculator/", "") end def description diff --git a/app/models/spree/order.rb b/app/models/spree/order.rb index 51851d032a..3dced4e802 100644 --- a/app/models/spree/order.rb +++ b/app/models/spree/order.rb @@ -205,7 +205,7 @@ module Spree end def display_payment_total - Spree::Money.new(self.payment_total, currency:) + Spree::Money.new(payment_total, currency:) end def to_param diff --git a/spec/controllers/spree/admin/shipping_methods_controller_spec.rb b/spec/controllers/spree/admin/shipping_methods_controller_spec.rb index dcc4f1c5c0..e93103e2d6 100644 --- a/spec/controllers/spree/admin/shipping_methods_controller_spec.rb +++ b/spec/controllers/spree/admin/shipping_methods_controller_spec.rb @@ -37,7 +37,7 @@ describe Spree::Admin::ShippingMethodsController, type: :controller do ].each do |shipping_amount| it "diplay error message on update if #{shipping_amount} input is invalid" do shipping_method.calculator = create(:calculator_flat_rate, calculable: shipping_method) - params[:shipping_method][:calculator_attributes][shipping_amount] = "\'20.0'" + params[:shipping_method][:calculator_attributes][shipping_amount] = "'20.0'" spree_post :update, params diff --git a/spec/system/admin/enterprise_fees_spec.rb b/spec/system/admin/enterprise_fees_spec.rb index 4cbaeea641..a227c0e49e 100644 --- a/spec/system/admin/enterprise_fees_spec.rb +++ b/spec/system/admin/enterprise_fees_spec.rb @@ -79,7 +79,7 @@ describe ' expect(page).to have_selector "input[value='Hello!']" # When I fill in the calculator fields and click update - fill_in("#{prefix}_calculator_attributes_preferred_flat_percent", with: "\'20.0'") + fill_in("#{prefix}_calculator_attributes_preferred_flat_percent", with: "'20.0'") click_button 'Update' # Then I should see the flash error message @@ -137,7 +137,7 @@ describe ' # When I fill in the calculator fields and click update fill_in( "#{prefix}_calculator_attributes_" \ - 'preferred_flat_percent', with: "\'20.0'" + 'preferred_flat_percent', with: "'20.0'" ) click_button 'Update'