Sha256: 11fb607e148fccbdfc161b24436f484e96e6f524a1489c84986f082bd5b91365
Contents?: true
Size: 1012 Bytes
Versions: 2
Compression:
Stored size: 1012 Bytes
Contents
require 'test_plugin_helper' module ForemanSalt class ReportImporterTest < ActiveSupport::TestCase setup do User.current = User.find_by_login 'admin' Setting[:create_new_host_when_facts_are_uploaded] = true @report = JSON.parse(File.read(File.join(Engine.root, 'test', 'unit', 'highstate.json'))) @host = 'saltclient713.example.com' end test 'importing report creates a host' do refute Host.find_by_name(@host) ForemanSalt::ReportImporter.import(@report) assert Host.find_by_name(@host) end test 'importing report updates host status' do ForemanSalt::ReportImporter.import(@report) assert Host.find_by_name(@host).get_status(HostStatus::ConfigurationStatus).error? end test 'importing report has correct status' do ForemanSalt::ReportImporter.import(@report) status = Host.find_by_name(@host).reports.last.status assert_equal status['applied'], 9 assert_equal status['failed'], 3 end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
foreman_salt-4.0.1 | test/unit/report_importer_test.rb |
foreman_salt-4.0.0 | test/unit/report_importer_test.rb |