diff --git a/spec/models/host_spec.rb b/spec/models/host_spec.rb index 045886fe772..3d86290e5cd 100644 --- a/spec/models/host_spec.rb +++ b/spec/models/host_spec.rb @@ -652,4 +652,20 @@ def assert_remote_credentials_validated MiqQueue.first.delivered(status, message, MiqAeEngine::MiqAeWorkspaceRuntime.new) end end + + context "#refresh_linux_packages" do + it "with utf-8 characters (like trademark)" do + rpm_list = "iwl3945-firmware|15.32.2.9|noarch|System Environment/Kernel|43.el7|Firmware for IntelĀ® PRO/Wireless 3945 A/B/G network adaptors" + mock_ssu = double("SSU", :shell_exec => rpm_list) + + expect(GuestApplication).to receive(:add_elements) do |_host, xml| + require 'nokogiri' + expect(Nokogiri::Slop(xml.to_s).miq.software.applications.children.first.attributes["description"].value).to eq( + "Firmware for IntelĀ® PRO/Wireless 3945 A/B/G network adaptors" + ) + end + + described_class.new.refresh_linux_packages(mock_ssu) + end + end end