mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-28 21:07:16 +00:00
23 lines
750 B
Ruby
23 lines
750 B
Ruby
require 'spec_helper'
|
|
|
|
describe ShopController do
|
|
it "should select an order cycle when only one order cycle is open" do
|
|
d = create(:distributor_enterprise)
|
|
oc1 = create(:order_cycle, distributors: [d])
|
|
controller.stub(:current_distributor).and_return d
|
|
spree_get :index
|
|
controller.current_order_cycle.should == oc1
|
|
end
|
|
|
|
it "should not set an order cycle when multiple order cycles are open" do
|
|
d = create(:distributor_enterprise)
|
|
oc1 = create(:order_cycle, distributors: [d])
|
|
oc2 = create(:order_cycle, distributors: [d])
|
|
controller.stub(:current_distributor).and_return d
|
|
spree_get :index
|
|
controller.current_order_cycle.should == nil
|
|
end
|
|
|
|
it "should create/load an order when loading show"
|
|
end
|