From 435bc177f89c6abd97fa593ffb06153215d24d45 Mon Sep 17 00:00:00 2001 From: Rob Harrington Date: Wed, 17 Dec 2014 12:58:00 +1100 Subject: [PATCH] Hiding side menu elements by filtering rather than by making invisible --- app/views/admin/enterprises/_side_menu.html.haml | 3 +-- spec/features/admin/enterprises_spec.rb | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/views/admin/enterprises/_side_menu.html.haml b/app/views/admin/enterprises/_side_menu.html.haml index a1d32d3ecc..34919ca169 100644 --- a/app/views/admin/enterprises/_side_menu.html.haml +++ b/app/views/admin/enterprises/_side_menu.html.haml @@ -1,7 +1,6 @@ .side_menu{ ng: { controller: 'sideMenuCtrl' } } %a.menu_item{ href: "#", id: "{{ item.name.toLowerCase().replace(' ', '_') }}", - ng: { repeat: '(index,item) in menu.items', - show: "item.visible", + ng: { repeat: '(index,item) in menu.items | filter:{visible:true}', click: 'select(index)', class: '{ selected: item.selected}', 'class-odd' => "'odd'", diff --git a/spec/features/admin/enterprises_spec.rb b/spec/features/admin/enterprises_spec.rb index 2d88480b31..f89b800f07 100644 --- a/spec/features/admin/enterprises_spec.rb +++ b/spec/features/admin/enterprises_spec.rb @@ -199,13 +199,13 @@ feature %q{ click_link "Primary Details" uncheck 'enterprise_is_primary_producer' choose 'None' - page.should have_selector "#enterprise_fees", visible: false - page.should have_selector "#payment_methods", visible: false - page.should have_selector "#shipping_methods", visible: false + page.should_not have_selector "#enterprise_fees" + page.should_not have_selector "#payment_methods" + page.should_not have_selector "#shipping_methods" check 'enterprise_is_primary_producer' page.should have_selector "#enterprise_fees" - page.should have_selector "#payment_methods", visible: false - page.should have_selector "#shipping_methods", visible: false + page.should_not have_selector "#payment_methods" + page.should_not have_selector "#shipping_methods" uncheck 'enterprise_is_primary_producer' choose 'Own' page.should have_selector "#enterprise_fees"