From a97efe434462144ce8ad222fd34eacfb72e17c78 Mon Sep 17 00:00:00 2001 From: Laura Galis Date: Thu, 17 Nov 2016 09:32:42 -0500 Subject: [PATCH 1/2] Add configuration_scripts to show_adv_search? --- app/helpers/application_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 0fefffe0946..6913f4ac0c2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1195,7 +1195,7 @@ def show_adv_search? ontap_file_share ontap_logical_disk ontap_storage_system ontap_storage_volume ems_network security_group floating_ip cloud_subnet network_router network_port cloud_network ems_storage load_balancer - orchestration_stack resource_pool retired service configuration_job + orchestration_stack resource_pool retired service configuration_job configuration_scripts snia_local_file_system storage_manager templates vm) (@lastaction == "show_list" && !session[:menu_click] && show_search.include?(@layout) && !@in_a_form) || (@explorer && x_tree && tree_with_advanced_search? && !@record) From 078643a6d36f16ee1a0cb228aaaf11b7f2d13c81 Mon Sep 17 00:00:00 2001 From: Laura Galis Date: Thu, 17 Nov 2016 11:33:34 -0500 Subject: [PATCH 2/2] Specs for show_adv_search for configuration scripts --- spec/helpers/application_helper_spec.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index a8f2897ed8f..e415b3865b7 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -1415,6 +1415,22 @@ result = helper.show_adv_search? expect(result).to be_truthy end + + it 'should return true for configuration scripts tree' do + controller.instance_variable_set(:@explorer, true) + controller.instance_variable_set(:@sb, + :active_tree => :configuration_scripts_tree, + :trees => { + :configuration_scripts_tree => { + :tree => :configuration_scripts_tree, + :type => :configuration_scripts + } + } + ) + allow(helper).to receive(:tree_with_advanced_search?).and_return(true) + result = helper.show_adv_search? + expect(result).to be_truthy + end end context "#show_advanced_search?" do