mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Show hubs that are not ready for checkout so that we can view SEFH - Sample :/
This commit is contained in:
@@ -13,6 +13,6 @@ class BaseController < ApplicationController
|
||||
before_filter :check_order_cycle_expiry
|
||||
|
||||
def load_active_distributors
|
||||
@active_distributors ||= Enterprise.distributors_with_active_order_cycles.ready_for_checkout
|
||||
@active_distributors ||= Enterprise.distributors_with_active_order_cycles
|
||||
end
|
||||
end
|
||||
|
||||
@@ -26,7 +26,7 @@ describe BaseController do
|
||||
end
|
||||
|
||||
it "loads active_distributors" do
|
||||
Enterprise.stub_chain(:distributors_with_active_order_cycles, :ready_for_checkout) { 'active distributors' }
|
||||
Enterprise.stub(:distributors_with_active_order_cycles) { 'active distributors' }
|
||||
controller.load_active_distributors.should == 'active distributors'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6,8 +6,7 @@ describe HomeController do
|
||||
let!(:invisible_distributor) { create(:distributor_enterprise, visible: false) }
|
||||
|
||||
before do
|
||||
Enterprise.stub_chain(:distributors_with_active_order_cycles, :ready_for_checkout).
|
||||
and_return [distributor]
|
||||
Enterprise.stub(:distributors_with_active_order_cycles) { [distributor] }
|
||||
end
|
||||
|
||||
it "sets active distributors" do
|
||||
|
||||
@@ -4,8 +4,7 @@ describe MapController do
|
||||
it "loads active distributors" do
|
||||
active_distributors = double(:distributors)
|
||||
|
||||
Enterprise.stub_chain(:distributors_with_active_order_cycles, :ready_for_checkout).
|
||||
and_return(active_distributors)
|
||||
Enterprise.stub(:distributors_with_active_order_cycles) { active_distributors }
|
||||
|
||||
get :index
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@ describe ProducersController do
|
||||
let!(:distributor) { create(:distributor_enterprise) }
|
||||
|
||||
before do
|
||||
Enterprise.stub_chain(:distributors_with_active_order_cycles, :ready_for_checkout).
|
||||
and_return([distributor])
|
||||
Enterprise.stub(:distributors_with_active_order_cycles) { [distributor] }
|
||||
Enterprise.stub(:all).and_return([distributor])
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user