Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing VM count back to quadicon for Infra Providers #2516

Merged
merged 1 commit into from
Oct 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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