From 403384dbb13f61a96b8daba71d351a3b873b8a69 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Fri, 30 Oct 2020 16:20:07 +0000 Subject: [PATCH] Fix rubocop isssues, trailing whitespaces and empty lines --- .rubocop_todo.yml | 19 ------------------- spec/factories.rb | 2 +- spec/factories/address_factory.rb | 2 +- .../customer_totals_report_spec.rb | 2 +- spec/requests/api/orders_spec.rb | 8 ++++---- 5 files changed, 7 insertions(+), 26 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 7f5820b719..937dc80352 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -6,25 +6,6 @@ # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 3 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: final_newline, final_blank_line -Layout/TrailingEmptyLines: - Exclude: - - 'spec/factories.rb' - - 'spec/factories/address_factory.rb' - - 'spec/support/request/stripe_helper.rb' - -# Offense count: 6 -# Cop supports --auto-correct. -# Configuration parameters: AllowInHeredoc. -Layout/TrailingWhitespace: - Exclude: - - 'spec/features/consumer/shopping/shopping_spec.rb' - - 'spec/lib/open_food_network/orders_and_fulfillments_report/customer_totals_report_spec.rb' - - 'spec/requests/api/orders_spec.rb' - # Offense count: 2 Lint/DuplicateMethods: Exclude: diff --git a/spec/factories.rb b/spec/factories.rb index a36cfcc9d3..1b12e67fbb 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -124,4 +124,4 @@ FactoryBot.define do stripe_user_id "abc123" stripe_publishable_key "xyz456" end -end \ No newline at end of file +end diff --git a/spec/factories/address_factory.rb b/spec/factories/address_factory.rb index b303e49ab0..1921e5034e 100644 --- a/spec/factories/address_factory.rb +++ b/spec/factories/address_factory.rb @@ -27,4 +27,4 @@ FactoryBot.define do phone { Faker::PhoneNumber.phone_number } end end -end \ No newline at end of file +end diff --git a/spec/lib/open_food_network/orders_and_fulfillments_report/customer_totals_report_spec.rb b/spec/lib/open_food_network/orders_and_fulfillments_report/customer_totals_report_spec.rb index 4799c3e4ac..882853ce7d 100644 --- a/spec/lib/open_food_network/orders_and_fulfillments_report/customer_totals_report_spec.rb +++ b/spec/lib/open_food_network/orders_and_fulfillments_report/customer_totals_report_spec.rb @@ -83,7 +83,7 @@ RSpec.describe OpenFoodNetwork::OrdersAndFulfillmentsReport::CustomerTotalsRepor context "displaying payment fees" do context "with both failed and completed payments present" do - let!(:order) { + let!(:order) { create(:order_ready_to_ship, user: customer.user, customer: customer, distributor: distributor) } diff --git a/spec/requests/api/orders_spec.rb b/spec/requests/api/orders_spec.rb index 815293be3c..50b2c677ff 100644 --- a/spec/requests/api/orders_spec.rb +++ b/spec/requests/api/orders_spec.rb @@ -20,9 +20,9 @@ describe 'api/orders', type: :request do response(200, 'get orders') do # Adds model metadata for Swagger UI. Ideally we'd be able to just add: # schema '$ref' => '#/components/schemas/Order_Concise' - # Which would also validate the response in the test, this is an open + # Which would also validate the response in the test, this is an open # issue with rswag: https://github.com/rswag/rswag/issues/268 - metadata[:response][:content] = { + metadata[:response][:content] = { "application/json": { schema: { '$ref' => '#/components/schemas/Order_Concise' } } @@ -64,7 +64,7 @@ describe 'api/orders', type: :request do end end - context "and queried within a date range" do + context "and queried within a date range" do let(:'q[completed_at_gt]') { Time.zone.today - 7.days - 1.second } let(:'q[completed_at_lt]') { Time.zone.today - 6.days } @@ -116,7 +116,7 @@ describe 'api/orders', type: :request do context "and queried by a specific order_cycle" do let(:'q[order_cycle_id_eq]') { - order_dist_2.order_cycle.id + order_dist_2.order_cycle.id } before { order_dist_2.distributor.update_attributes owner: user }