From 888e4d80efe906fd60099b2a4ae6995923424b29 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Tue, 10 Nov 2015 10:37:37 +1100 Subject: [PATCH] Add reliable way to check if cart is dirty. Previous way returned true when cart empty. --- app/views/shared/menu/_cart.html.haml | 2 +- spec/support/request/ui_component_helper.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/shared/menu/_cart.html.haml b/app/views/shared/menu/_cart.html.haml index f4d3e00c67..6fc538a752 100644 --- a/app/views/shared/menu/_cart.html.haml +++ b/app/views/shared/menu/_cart.html.haml @@ -1,4 +1,4 @@ -%span.cart-span{"ng-controller" => "CartCtrl", "ng-class" => "{ dirty: Cart.dirty || Cart.empty() }"} +%span.cart-span{"ng-controller" => "CartCtrl", "ng-class" => "{ dirty: Cart.dirty || Cart.empty(), 'pure-dirty': Cart.dirty }"} %a#cart.icon{cart: true} %span.nav-branded %i.ofn-i_027-shopping-cart diff --git a/spec/support/request/ui_component_helper.rb b/spec/support/request/ui_component_helper.rb index d9f01b447b..35bf628bc0 100644 --- a/spec/support/request/ui_component_helper.rb +++ b/spec/support/request/ui_component_helper.rb @@ -36,7 +36,7 @@ module UIComponentHelper end def have_login_modal - have_selector ".login-modal" + have_selector ".login-modal" end def open_product_modal(product) @@ -69,7 +69,7 @@ module UIComponentHelper end def cart_dirty - page.find("span.cart-span")[:class].include? 'dirty' + page.find("span.cart-span")[:class].include? 'pure-dirty' end def wait_for_ajax @@ -100,7 +100,7 @@ module UIComponentHelper def expand_active_table_node(name) find(".active_table_node", text: name).click end - + def follow_active_table_node(name) expand_active_table_node(name) find(".active_table_node a", text: "#{name}").click