From 34f170d4f71bbc3d575f98a1d4afc0b2305ae814 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 2 May 2014 10:18:57 +1000 Subject: [PATCH] Bugged thing in the shop spec --- app/controllers/shop/shop_controller.rb | 5 ++--- spec/features/consumer/shopping/shopping_spec.rb | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/controllers/shop/shop_controller.rb b/app/controllers/shop/shop_controller.rb index d06b521e9b..7b9956cbee 100644 --- a/app/controllers/shop/shop_controller.rb +++ b/app/controllers/shop/shop_controller.rb @@ -1,7 +1,7 @@ class Shop::ShopController < BaseController layout "darkswarm" before_filter :require_distributor_chosen - before_filter :set_order_cycles, only: :show + before_filter :set_order_cycles def show end @@ -11,7 +11,6 @@ class Shop::ShopController < BaseController .valid_products_distributed_by(current_distributor).andand .select { |p| !p.deleted? && p.has_stock_for_distribution?(current_order_cycle, current_distributor) }.andand .sort_by {|p| p.name } - render json: "", status: 404 end end @@ -35,7 +34,7 @@ class Shop::ShopController < BaseController @order_cycles = OrderCycle.with_distributor(@distributor).active # And default to the only order cycle if there's only the one - if @order_cycles.count == 1 + if @order_cycles.count == 1 and current_order_cycle.nil? current_order(true).set_order_cycle! @order_cycles.first end end diff --git a/spec/features/consumer/shopping/shopping_spec.rb b/spec/features/consumer/shopping/shopping_spec.rb index 2fbb4af1d5..19fcb5a44b 100644 --- a/spec/features/consumer/shopping/shopping_spec.rb +++ b/spec/features/consumer/shopping/shopping_spec.rb @@ -115,7 +115,6 @@ feature "As a consumer I want to shop with a distributor", js: true do page.should have_selector 'tr.product > td', text: "from $43.00" end end - describe "group buy products" do let(:exchange) { Exchange.find(oc1.exchanges.to_enterprises(distributor).outgoing.first.id) }