From 5a85d7a77b5228f54caa99f6d6791d58d462f7fa Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Mon, 26 Nov 2018 12:27:30 +0100 Subject: [PATCH] RSpec3-ize controller spec --- spec/controllers/shops_controller_spec.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/controllers/shops_controller_spec.rb b/spec/controllers/shops_controller_spec.rb index 400fa2f563..44f896d5f3 100644 --- a/spec/controllers/shops_controller_spec.rb +++ b/spec/controllers/shops_controller_spec.rb @@ -2,16 +2,17 @@ require 'spec_helper' describe ShopsController, type: :controller do render_views + let!(:distributor) { create(:distributor_enterprise) } let!(:invisible_distributor) { create(:distributor_enterprise, visible: false) } before do - Enterprise.stub_chain("distributors_with_active_order_cycles.ready_for_checkout") { [distributor] } + allow(Enterprise).to receive_message_chain(:distributors_with_active_order_cycles, :ready_for_checkout) { [distributor] } end # Exclusion from actual rendered view handled in features/consumer/home it "shows JSON for invisible hubs" do get :index - response.body.should have_content invisible_distributor.name + expect(response.body).to have_content(invisible_distributor.name) end end