From 43bac4079f2f54c94e7a3ed2ff9e3ea521269b66 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Thu, 13 Nov 2014 15:21:02 +1100 Subject: [PATCH] Show hubs that are not ready for checkout so that we can view SEFH - Sample :/ --- app/controllers/base_controller.rb | 2 +- spec/controllers/base_controller_spec.rb | 2 +- spec/controllers/home_controller_spec.rb | 3 +-- spec/controllers/map_controller_spec.rb | 3 +-- spec/controllers/producers_controller_spec.rb | 3 +-- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/app/controllers/base_controller.rb b/app/controllers/base_controller.rb index 88c0f89aec..2ac35fa3ad 100644 --- a/app/controllers/base_controller.rb +++ b/app/controllers/base_controller.rb @@ -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 diff --git a/spec/controllers/base_controller_spec.rb b/spec/controllers/base_controller_spec.rb index 822da57ba5..1040b0594c 100644 --- a/spec/controllers/base_controller_spec.rb +++ b/spec/controllers/base_controller_spec.rb @@ -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 diff --git a/spec/controllers/home_controller_spec.rb b/spec/controllers/home_controller_spec.rb index 16367eb812..bbbff9a7b1 100644 --- a/spec/controllers/home_controller_spec.rb +++ b/spec/controllers/home_controller_spec.rb @@ -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 diff --git a/spec/controllers/map_controller_spec.rb b/spec/controllers/map_controller_spec.rb index c4e98def8a..fab9b7ac22 100644 --- a/spec/controllers/map_controller_spec.rb +++ b/spec/controllers/map_controller_spec.rb @@ -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 diff --git a/spec/controllers/producers_controller_spec.rb b/spec/controllers/producers_controller_spec.rb index 2b7377a471..ec3c39036c 100644 --- a/spec/controllers/producers_controller_spec.rb +++ b/spec/controllers/producers_controller_spec.rb @@ -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