From a43ceffae272a90da7d3b790445816bb75f30d1b Mon Sep 17 00:00:00 2001 From: lgalis Date: Wed, 24 May 2017 13:49:23 -0400 Subject: [PATCH] Specs for automation manager gtl toolbar when refreshed from hash --- .../toolbar_chooser_spec.rb | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/spec/helpers/application_helper/toolbar_chooser_spec.rb b/spec/helpers/application_helper/toolbar_chooser_spec.rb index 08a9621bf3e..d534b3ca3e7 100644 --- a/spec/helpers/application_helper/toolbar_chooser_spec.rb +++ b/spec/helpers/application_helper/toolbar_chooser_spec.rb @@ -153,4 +153,24 @@ it { is_expected.to be_falsey } end end + + describe '#x_view_toolbar_filename' do + before do + @record = FactoryGirl.create(:inventory_root_group) + end + + context 'when the active tab is summary' do + it "displays summary toolbar" do + @sb = {:active_tab => 'summary'} + expect(ApplicationHelper::ToolbarChooser.new(nil, nil, :record => @record, :explorer => true, :layout => 'automation_manager', :sb => @sb).send(:x_view_toolbar_filename)).to eq("x_summary_view_tb") + end + end + + context ' when the active tab is configured_systems' do + it "displays summary toolbar" do + @sb = {:active_tab => 'configured_systems'} + expect(ApplicationHelper::ToolbarChooser.new(nil, nil, :record => @record, :explorer => true, :layout => 'automation_manager', :sb => @sb).send(:x_view_toolbar_filename)).to eq("x_gtl_view_tb") + end + end + end end