mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Bugged thing in the shop spec
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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) }
|
||||
|
||||
Reference in New Issue
Block a user