Add spec for OrderPopulator#set_cart_distributor_and_order_cycle

This commit is contained in:
Rohan Mitchell
2013-06-05 15:04:42 +10:00
parent bfc300a3c2
commit 3724a67d16

View File

@@ -2,7 +2,7 @@ require 'spec_helper'
module Spree
describe OrderPopulator do
let(:order) { double(:order) }
let(:order) { double(:order, id: 123) }
let(:currency) { double(:currency) }
let(:params) { double(:params) }
let(:distributor) { double(:distributor) }
@@ -90,7 +90,13 @@ module Spree
end
end
it "sets cart distributor and order cycle"
it "sets cart distributor and order cycle" do
Spree::Order.should_receive(:find).with(order.id).and_return(order)
order.should_receive(:set_distributor!).with(distributor)
order.should_receive(:set_order_cycle!).with(order_cycle)
op.send(:set_cart_distributor_and_order_cycle, distributor, order_cycle)
end
end
describe "validations" do