Skip to content

Commit

Permalink
Add test for Host#refresh_linux_packages
Browse files Browse the repository at this point in the history
  • Loading branch information
bdunne committed May 19, 2017
1 parent de76957 commit 068a609
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions spec/models/host_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 068a609

Please sign in to comment.