Skip to content

Commit

Permalink
Added current_order_params to simple_current_order
Browse files Browse the repository at this point in the history
Using the current_order_params sets the store and user similar
to the current_order method.
  • Loading branch information
ericsaupe committed May 22, 2017
1 parent 2a5b222 commit dc5d60b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/lib/spree/core/controller_helpers/order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def simple_current_order
@simple_current_order.last_ip_address = ip_address
return @simple_current_order
else
@simple_current_order = Spree::Order.new
@simple_current_order = Spree::Order.new(current_order_params)
end
end

Expand Down
3 changes: 3 additions & 0 deletions core/spec/lib/spree/core/controller_helpers/order_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class FakesController < ApplicationController
allow(controller).to receive_messages(cookies: double(signed: { guest_token: order.guest_token }))
expect(controller.simple_current_order).to eq order
end
it 'assigns the current_store id' do
expect(controller.simple_current_order.store_id).to eq store.id
end
end

describe '#current_order' do
Expand Down

0 comments on commit dc5d60b

Please sign in to comment.