From 2baf7c0250c67fed49e3b38cefd416ce20d651fc Mon Sep 17 00:00:00 2001 From: cyrillefr Date: Fri, 12 Jul 2024 14:13:17 +0200 Subject: [PATCH] Fixex Rails/RootPathnameMethods offense - Cf. Cop doc at https://docs.rubocop.org/rubocop-rails/cops_rails.html#railsrootpathnamemethods --- .rubocop_todo.yml | 6 ------ .../order_cycle_customer_totals_report_spec.rb | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index f3efe519c0..67c5216f87 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -638,12 +638,6 @@ Rails/ResponseParsedBody: - 'spec/controllers/spree/credit_cards_controller_spec.rb' - 'spec/controllers/user_registrations_controller_spec.rb' -# Offense count: 1 -# This cop supports unsafe autocorrection (--autocorrect-all). -Rails/RootPathnameMethods: - Exclude: - - 'spec/lib/reports/orders_and_fulfillment/order_cycle_customer_totals_report_spec.rb' - # Offense count: 7 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. diff --git a/spec/lib/reports/orders_and_fulfillment/order_cycle_customer_totals_report_spec.rb b/spec/lib/reports/orders_and_fulfillment/order_cycle_customer_totals_report_spec.rb index 8ca2d09130..d9b171ccef 100644 --- a/spec/lib/reports/orders_and_fulfillment/order_cycle_customer_totals_report_spec.rb +++ b/spec/lib/reports/orders_and_fulfillment/order_cycle_customer_totals_report_spec.rb @@ -35,7 +35,7 @@ RSpec.describe Reporting::Reports::OrdersAndFulfillment::OrderCycleCustomerTotal end end let(:comparison_report) do - File.read(Rails.root.join(report_file_name)) + Rails.root.join(report_file_name).read end let(:report_file_name) do "spec/fixtures/reports/orders_and_fulfillment/order_cycle_customer_totals_report.csv"