From c6d6b6f65a8625574232605fa9dfaf1152fc1755 Mon Sep 17 00:00:00 2001 From: Jason Hsu Date: Tue, 13 Oct 2020 12:01:11 -0500 Subject: [PATCH 1/3] Removed empty trailing line in spec/support/request/stripe_helper.rb; reduces RuboCop offenses from 110 to 109 --- spec/support/request/stripe_helper.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/spec/support/request/stripe_helper.rb b/spec/support/request/stripe_helper.rb index 120b5c8bfc..608b1cadd0 100644 --- a/spec/support/request/stripe_helper.rb +++ b/spec/support/request/stripe_helper.rb @@ -92,4 +92,3 @@ module StripeHelper body: JSON.generate(id: "pm_456", customer: "cus_A123") } end end - From 0d051b7c7d24c0af58205ccd5897274b5fb5f60e Mon Sep 17 00:00:00 2001 From: Jason Hsu Date: Tue, 13 Oct 2020 12:05:50 -0500 Subject: [PATCH 2/3] Added '# frozen_string_literal: true' to spec/support/request/checkout_helper.rb; reduces number of RuboCop offenses from 109 to 108 --- spec/support/request/checkout_helper.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/support/request/checkout_helper.rb b/spec/support/request/checkout_helper.rb index e969abce63..d08cae5ceb 100644 --- a/spec/support/request/checkout_helper.rb +++ b/spec/support/request/checkout_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module CheckoutHelper def have_checkout_details have_content "Your details" From a8eaabc5daccea7097d51b55c47aa47e5ac0f163 Mon Sep 17 00:00:00 2001 From: Jason Hsu Date: Tue, 13 Oct 2020 12:14:15 -0500 Subject: [PATCH 3/3] Used guard clause in spec/support/request/checkout_helper.rb instead of an if statement with two actions; reduces the number of RuboCop offenses from 108 to 107 --- spec/support/request/checkout_helper.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/support/request/checkout_helper.rb b/spec/support/request/checkout_helper.rb index d08cae5ceb..e27ffd27ed 100644 --- a/spec/support/request/checkout_helper.rb +++ b/spec/support/request/checkout_helper.rb @@ -49,9 +49,9 @@ module CheckoutHelper fill_out_billing_address - if save_default_addresses - check "Shipping address same as billing address?" - check "Save as default shipping address" - end + return unless save_default_addresses + + check "Shipping address same as billing address?" + check "Save as default shipping address" end end