Fix calls to private method #expire_current_order in specs

This commit is contained in:
Matt-Yorkley
2021-12-07 19:41:16 +00:00
parent 7fe770a855
commit 9b2801db24
2 changed files with 4 additions and 4 deletions

View File

@@ -315,11 +315,11 @@ describe CheckoutController, type: :controller do
describe '#expire_current_order' do
it 'empties the order_id of the session' do
expect(session).to receive(:[]=).with(:order_id, nil)
controller.expire_current_order
controller.send(:expire_current_order)
end
it 'resets the @current_order ivar' do
controller.expire_current_order
controller.send(:expire_current_order)
expect(controller.instance_variable_get(:@current_order)).to be_nil
end
end

View File

@@ -104,11 +104,11 @@ module PaymentGateways
describe '#expire_current_order' do
it 'empties the order_id of the session' do
expect(session).to receive(:[]=).with(:order_id, nil)
controller.expire_current_order
controller.send(:expire_current_order)
end
it 'resets the @current_order ivar' do
controller.expire_current_order
controller.send(:expire_current_order)
expect(controller.instance_variable_get(:@current_order)).to be_nil
end
end