mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-01 21:47:16 +00:00
22 lines
652 B
Ruby
22 lines
652 B
Ruby
require 'spec_helper'
|
|
|
|
describe Shop::CheckoutController do
|
|
it "redirects home when no distributor is selected" do
|
|
get :new
|
|
response.should redirect_to root_path
|
|
end
|
|
|
|
it "redirects to the shop when no order cycle is selected" do
|
|
controller.stub(:current_distributor).and_return(double(:distributor))
|
|
get :new
|
|
response.should redirect_to shop_path
|
|
end
|
|
|
|
it "renders when both distributor and order cycle is selected" do
|
|
controller.stub(:current_distributor).and_return(double(:distributor))
|
|
controller.stub(:current_order_cycle).and_return(create(:order_cycle))
|
|
get :new
|
|
response.should be_success
|
|
end
|
|
end
|