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

Ensure remaining models are translated but not through rails' titleize #20361

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
2 changes: 1 addition & 1 deletion app/models/miq_compare.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def section_header_text(model)
when "VmOrTemplate"
_("Workload")
else
model.titleize
ui_lookup(:model => model)
end
end

Expand Down
24 changes: 24 additions & 0 deletions spec/models/miq_compare_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,28 @@
expect { loaded = Marshal.load(dumped) }.not_to raise_error
end
end

context "headers are translated" do
it "for EmsCluster" do
skip "Assumptions based on English message catalog" unless FastGettext.locale == "en"

obj1 = FactoryBot.create(:ems_cluster)
obj2 = FactoryBot.create(:ems_cluster)
MiqReport.seed_report("clusters")
report = MiqReport.find_by(:title => "Cluster Compare Template")
compare = MiqCompare.new({:ids => [obj1.id, obj2.id]}, report)
expect(compare.master_list[0][:header]).to eq("Cluster")
end

it "for Host" do
skip "Assumptions based on English message catalog" unless FastGettext.locale == "en"

obj1 = FactoryBot.create(:host_vmware)
obj2 = FactoryBot.create(:host_vmware)
MiqReport.seed_report("hosts")
report = MiqReport.find_by(:name => "Hosts: Compare Template")
compare = MiqCompare.new({:ids => [obj1.id, obj2.id]}, report)
expect(compare.master_list[0][:header]).to eq("Host Properties")
end
end
end