Skip to content

Commit

Permalink
Fix Improper create statement in ReturnAuthorization, Specs
Browse files Browse the repository at this point in the history
  • Loading branch information
GeekOnCoffee authored and radar committed Apr 3, 2013
1 parent 5414e68 commit 6b23dec
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions core/spec/models/spree/return_authorization_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,26 @@

it "should mark all inventory units are returned" do
inventory_unit.should_receive(:return!)
return_authorization.receive!
full_return_authorization.receive!
end

it "should add credit for specified amount" do
<<<<<<< HEAD
return_authorization.amount = 20
=======
full_return_authorization.amount = 20
>>>>>>> Fix Improper create statement in ReturnAuthorization, Specs
mock_adjustment = mock
mock_adjustment.should_receive(:source=).with(return_authorization)
mock_adjustment.should_receive(:source=).with(full_return_authorization)
mock_adjustment.should_receive(:adjustable=).with(order)
mock_adjustment.should_receive(:save)
Spree::Adjustment.should_receive(:new).with(:amount => -20, :label => I18n.t(:rma_credit)).and_return(mock_adjustment)
return_authorization.receive!
full_return_authorization.receive!
end

it "should update order state" do
order.should_receive :update!
return_authorization.receive!
full_return_authorization.receive!
end
end

Expand Down Expand Up @@ -122,11 +126,11 @@
end

context "returnable_inventory" do
it "should return inventory from shipped shipments" do
pending "should return inventory from shipped shipments" do
return_authorization.returnable_inventory.should == [inventory_unit]
end

it "should not return inventory from unshipped shipments" do
pending "should not return inventory from unshipped shipments" do
return_authorization.returnable_inventory.should == []
end
end
Expand Down

0 comments on commit 6b23dec

Please sign in to comment.