From 13b8cfcd9c8d5200a6103e5d2c5cfd4e214f2408 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Mon, 2 Mar 2020 20:37:58 +0100 Subject: [PATCH] Remove assignment of invalid attribute in test setup Fixes: 11) Order Management viewing a completed order when checking out as an anonymous guest allows the user to see the details Failure/Error: order.update_attributes!( bill_address: bill_address, ship_address: ship_address, shipping_method_id: shipping_method.id ) ActiveRecord::UnknownAttributeError: unknown attribute: shipping_method_id # ./spec/features/consumer/shopping/orders_spec.rb:30:in `block (3 levels) in ' # ------------------ # --- Caused by: --- # NoMethodError: # undefined method `shipping_method_id=' for # # ./spec/features/consumer/shopping/orders_spec.rb:30:in `block (3 levels) in ' 12) Order Management viewing a completed order when logged in as the customer allows the user to see order details Failure/Error: order.update_attributes!( bill_address: bill_address, ship_address: ship_address, shipping_method_id: shipping_method.id ) ActiveRecord::UnknownAttributeError: unknown attribute: shipping_method_id # ./spec/features/consumer/shopping/orders_spec.rb:30:in `block (3 levels) in ' # ------------------ # --- Caused by: --- # NoMethodError: # undefined method `shipping_method_id=' for # # ./spec/features/consumer/shopping/orders_spec.rb:30:in `block (3 levels) in ' 13) Order Management viewing a completed order when not logged in allows the user to see order details after login Failure/Error: order.update_attributes!( bill_address: bill_address, ship_address: ship_address, shipping_method_id: shipping_method.id ) ActiveRecord::UnknownAttributeError: unknown attribute: shipping_method_id # ./spec/features/consumer/shopping/orders_spec.rb:30:in `block (3 levels) in ' # ------------------ # --- Caused by: --- # NoMethodError: # undefined method `shipping_method_id=' for # # ./spec/features/consumer/shopping/orders_spec.rb:30:in `block (3 levels) in ' --- spec/features/consumer/shopping/orders_spec.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/spec/features/consumer/shopping/orders_spec.rb b/spec/features/consumer/shopping/orders_spec.rb index 90c3e6ad5f..e9b342c1c7 100644 --- a/spec/features/consumer/shopping/orders_spec.rb +++ b/spec/features/consumer/shopping/orders_spec.rb @@ -24,13 +24,9 @@ feature "Order Management", js: true do before do # For some reason, both bill_address and ship_address are not set # automatically. - # - # Also, assigning the shipping_method to a ShippingMethod instance results - # in a SystemStackError. order.update_attributes!( bill_address: bill_address, - ship_address: ship_address, - shipping_method_id: shipping_method.id + ship_address: ship_address ) end