Skip to content

Commit

Permalink
Add missing VM count back to quadicon for Infra Providers
Browse files Browse the repository at this point in the history
  • Loading branch information
bmclaughlin committed Oct 25, 2017
1 parent 1506f61 commit 5c06b06
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/helpers/quadicon_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ def render_ext_management_system_quadicon(item, options)
# reduce font-size of the item_count so it will fit in its quadrant
output << flobj_p_simple("a72", item_count, item_count.to_s.size > 2 ? "font-size: 12px;" : "")
output << flobj_p_simple("b72", item.total_miq_templates) if item.kind_of?(EmsCloud)
output << flobj_p_simple("b72", item.total_vms) if item.kind_of?(EmsInfra)
output << currentstate_icon(item.enabled? ? "on" : "paused") if item.kind_of?(::ManageIQ::Providers::ContainerManager)
output << flobj_img_simple("svg/vendor-#{h(item.image_name)}.svg", "c72")
output << flobj_img_simple(img_for_auth_status(item), "d72")
Expand Down
5 changes: 5 additions & 0 deletions spec/helpers/quadicon_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@
@settings = {:quadicons => {:ems => true}}
allow(item).to receive(:hosts).and_return(%w(foo bar))
allow(item).to receive(:image_name).and_return("foo")
allow(item).to receive(:total_vms).and_return('42')
@layout = "ems_infra"
end

Expand All @@ -649,6 +650,10 @@
expect(ext_quad).to match(/Hostname/)
end

it "displays the total VM count" do
expect(ext_quad).to have_selector('p', :text => item.total_vms.to_s)
end

context "when type is not listicon" do
let(:item) { FactoryGirl.create(:ems_infra) }

Expand Down

0 comments on commit 5c06b06

Please sign in to comment.