From a8eaabc5daccea7097d51b55c47aa47e5ac0f163 Mon Sep 17 00:00:00 2001 From: Jason Hsu Date: Tue, 13 Oct 2020 12:14:15 -0500 Subject: [PATCH] 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