From 29ba0ccc9755b82ca27e201766fb92b275a6b7b4 Mon Sep 17 00:00:00 2001 From: Rob H Date: Fri, 10 Jan 2014 00:46:42 +0800 Subject: [PATCH] Initialise BPE page with 'Available On' column hidden --- .../javascripts/admin/bulk_product_update.js.coffee | 2 +- spec/features/admin/bulk_product_update_spec.rb | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/admin/bulk_product_update.js.coffee b/app/assets/javascripts/admin/bulk_product_update.js.coffee index 328b813ebf..90b612ccd3 100644 --- a/app/assets/javascripts/admin/bulk_product_update.js.coffee +++ b/app/assets/javascripts/admin/bulk_product_update.js.coffee @@ -127,7 +127,7 @@ productsApp.controller "AdminBulkProductsCtrl", [ unit: {name: "Unit", visible: true} price: {name: "Price", visible: true} on_hand: {name: "On Hand", visible: true} - available_on: {name: "Available On", visible: true} + available_on: {name: "Available On", visible: false} $scope.variant_unit_options = [ ["Weight (g)", "weight_1"], diff --git a/spec/features/admin/bulk_product_update_spec.rb b/spec/features/admin/bulk_product_update_spec.rb index e9dae33a81..a61123be5a 100644 --- a/spec/features/admin/bulk_product_update_spec.rb +++ b/spec/features/admin/bulk_product_update_spec.rb @@ -240,6 +240,9 @@ feature %q{ login_to_admin_section visit '/admin/products/bulk_edit' + + first("div.option_tab_titles h6", :text => "Toggle Columns").click + first("li.column-list-item", text: "Available On").click page.should have_field "product_name", with: p.name page.should have_select "supplier", selected: s1.name @@ -580,6 +583,9 @@ feature %q{ login_to_admin_section visit '/admin/products/bulk_edit' + + first("div.option_tab_titles h6", :text => "Toggle Columns").click + first("li.column-list-item", text: "Available On").click page.should have_selector "th", :text => "NAME" page.should have_selector "th", :text => "SUPPLIER" @@ -589,10 +595,8 @@ feature %q{ page.should have_selector "div.option_tab_titles h6", :text => "Toggle Columns" - first("div.option_tab_titles h6", :text => "Toggle Columns").click - page.should have_selector "div ul.column-list li.column-list-item", text: "Supplier" - all("div ul.column-list li.column-list-item").select{ |e| e.text == "Supplier" }.first.click + first("li.column-list-item", text: "Supplier").click page.should_not have_selector "th", :text => "SUPPLIER" page.should have_selector "th", :text => "NAME" @@ -789,6 +793,9 @@ feature %q{ p = product_supplied visit '/admin/products/bulk_edit' + + first("div.option_tab_titles h6", :text => "Toggle Columns").click + first("li.column-list-item", text: "Available On").click page.should have_field "product_name", with: p.name page.should have_select "supplier", selected: s1.name