mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-06 22:36:07 +00:00
Add spec for OrderPopulator#set_cart_distributor_and_order_cycle
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user