diff --git a/app/overrides/spree/products/index/change_product_render_logic.html.haml.deface b/app/overrides/spree/products/index/change_product_render_logic.html.haml.deface new file mode 100644 index 0000000000..55f7f62d08 --- /dev/null +++ b/app/overrides/spree/products/index/change_product_render_logic.html.haml.deface @@ -0,0 +1,7 @@ +/ replace_contents "[data-hook='homepage_products']" + +- if current_order_cycle + - if @products.empty? + %h6.search-results-title= t(:no_products_found) + - else + = render :partial => 'spree/shared/products', :locals => { :products => @products, :taxon => @taxon } diff --git a/spec/features/consumer/order_cycles_spec.rb b/spec/features/consumer/order_cycles_spec.rb index e5d0e8d819..dedd77e1cb 100644 --- a/spec/features/consumer/order_cycles_spec.rb +++ b/spec/features/consumer/order_cycles_spec.rb @@ -83,6 +83,7 @@ feature %q{ it "should show nothing when there is no next order cycle" do click_link d1.name page.should_not have_content "The next order cycle opens" + page.should_not have_content "No products found" end end end @@ -102,17 +103,21 @@ feature %q{ click_link 'Continue shopping' click_link 'Change Collection Date' + # Then we should be back at the landing page with a reset cart page.should have_content 'Green Grass' page.should have_content 'When do you want your order?' + # When we get taken back to select order cycle, there is no selected order cycle + # Therefore we should not see the no products info + page.should_not have_content "No products found" + cart = Spree::Order.last cart.distributor.should == d cart.order_cycle.should be_nil cart.line_items.should be_empty end - scenario "viewing order cycle and distributor choices", :future => true do # When I go to the product listing page visit spree.products_path