mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-30 21:27:17 +00:00
21 lines
498 B
Ruby
21 lines
498 B
Ruby
require 'spec_helper'
|
|
|
|
describe ProducersController do
|
|
let!(:distributor) { create(:distributor_enterprise) }
|
|
|
|
before do
|
|
Enterprise.stub(:distributors_with_active_order_cycles).and_return [distributor]
|
|
Enterprise.stub(:visible).and_return [distributor]
|
|
end
|
|
|
|
it "sets active distributors" do
|
|
get :index
|
|
assigns[:active_distributors].should == [distributor]
|
|
end
|
|
|
|
it "loads visible enterprises" do
|
|
get :index
|
|
assigns[:enterprises].should == [distributor]
|
|
end
|
|
end
|