Bugged thing in the shop spec

This commit is contained in:
Will Marshall
2014-05-02 10:18:57 +10:00
parent 1703f7503b
commit 34f170d4f7
2 changed files with 2 additions and 4 deletions

View File

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

View File

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