diff --git a/spec/controllers/host_controller_spec.rb b/spec/controllers/host_controller_spec.rb index 5261e400d58f..d6ee86ed5d10 100644 --- a/spec/controllers/host_controller_spec.rb +++ b/spec/controllers/host_controller_spec.rb @@ -21,18 +21,17 @@ it "renders show_list and does not include hidden column" do allow(controller).to receive(:render) report = FactoryGirl.create(:miq_report, - :name => 'Hosts', - :title => 'Hosts', - :cols => ['name', 'ipaddress', 'v_total_vms'], - :col_order => ['name', 'ipaddress', 'v_total_vms'], - :headers => ['Name', 'IP Address', 'VMs'], - :col_options => {"name" => {:hidden=>true}} - ) + :name => 'Hosts', + :title => 'Hosts', + :cols => %w(name ipaddress v_total_vms), + :col_order => %w(name ipaddress v_total_vms), + :headers => %w(Name IP\ Address VMs), + :col_options => {"name" => {:hidden => true}}) expect(controller).to receive(:get_db_view).and_return(report) controller.send(:report_data) view_hash = controller.send(:view_to_hash, assigns(:view)) - expect(view_hash[:head]).not_to include({:text => "Name", :sort => "str", :col_idx => 0, :align => "left"}) - expect(view_hash[:head]).to include({:text => "IP Address", :sort => "str", :col_idx => 1, :align => "left"}) + expect(view_hash[:head]).not_to include(:text => "Name", :sort => "str", :col_idx => 0, :align => "left") + expect(view_hash[:head]).to include(:text => "IP Address", :sort => "str", :col_idx => 1, :align => "left") end it "renders show_list and includes all columns" do @@ -40,15 +39,14 @@ report = FactoryGirl.create(:miq_report, :name => 'Hosts', :title => 'Hosts', - :cols => ['name', 'ipaddress', 'v_total_vms'], - :col_order => ['name', 'ipaddress', 'v_total_vms'], - :headers => ['Name', 'IP Address', 'VMs'] - ) + :cols => %w(name ipaddress v_total_vms), + :col_order => %w(name ipaddress v_total_vms), + :headers => %w(Name IP\ Address VMs)) expect(controller).to receive(:get_db_view).and_return(report) controller.send(:report_data) view_hash = controller.send(:view_to_hash, assigns(:view)) - expect(view_hash[:head]).to include({:text => "Name", :sort => "str", :col_idx => 0, :align => "left"}) - expect(view_hash[:head]).to include({:text => "IP Address", :sort => "str", :col_idx => 1, :align => "left"}) + expect(view_hash[:head]).to include(:text => "Name", :sort => "str", :col_idx => 0, :align => "left") + expect(view_hash[:head]).to include(:text => "IP Address", :sort => "str", :col_idx => 1, :align => "left") end it 'edit renders GTL grid with selected Host records' do