Show hubs that are not ready for checkout so that we can view SEFH - Sample :/

This commit is contained in:
Rohan Mitchell
2014-11-13 15:21:02 +11:00
parent 43ddac84b0
commit 43bac4079f
5 changed files with 5 additions and 8 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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