From 89cb4473870f707ed65456ba5a272048f4cea310 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Sat, 2 May 2020 17:56:49 +0100 Subject: [PATCH] Hide OC selector if shop requires login/customer --- app/views/shopping_shared/_order_cycles.html.haml | 2 +- spec/features/consumer/shopping/shopping_spec.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/shopping_shared/_order_cycles.html.haml b/app/views/shopping_shared/_order_cycles.html.haml index 24148411fe..eb83cf70e7 100644 --- a/app/views/shopping_shared/_order_cycles.html.haml +++ b/app/views/shopping_shared/_order_cycles.html.haml @@ -1,7 +1,7 @@ - content_for :injection_data do = inject_current_order_cycle -- unless no_open_order_cycles? +- unless no_open_order_cycles? || require_customer? %ordercycle{"ng-controller" => "OrderCycleCtrl", "ng-cloak" => true, "ng-class" => "{'requires-selection': !OrderCycle.selected()}"} %form.custom diff --git a/spec/features/consumer/shopping/shopping_spec.rb b/spec/features/consumer/shopping/shopping_spec.rb index b8a6727727..d7afd20aab 100644 --- a/spec/features/consumer/shopping/shopping_spec.rb +++ b/spec/features/consumer/shopping/shopping_spec.rb @@ -466,6 +466,7 @@ feature "As a consumer I want to shop with a distributor", js: true do expect(page).to have_content "Only approved customers can access this shop." expect(page).to have_content "login or signup" expect(page).to have_no_content product.name + expect(page).not_to have_selector "ordercycle" end end @@ -483,6 +484,7 @@ feature "As a consumer I want to shop with a distributor", js: true do expect(page).to have_content "Only approved customers can access this shop." expect(page).to have_content "please contact #{distributor.name}" expect(page).to have_no_content product.name + expect(page).not_to have_selector "ordercycle" end end