Sha256: 3f4b0a581ea95a7a467393e8606fc6b6746b82779ae583dfa2272fde648f3bb9
Contents?: true
Size: 772 Bytes
Versions: 13
Compression:
Stored size: 772 Bytes
Contents
require 'test_plugin_helper' # Unit tests for AnsibleReportImporter # This class is just meant to capture the config reports coming # from Ansible and change anything that is required class AnsibleReportImporterTest < ActiveSupport::TestCase setup do @raw = { 'host' => '192.168.121.1' } @importer = ::ConfigReportImporter.new(@raw) end test 'finds host when the hostname is given as the IP' do host = ::FactoryBot.create(:host, :ip => @raw['host']) ForemanAnsible::AnsibleReportScanner.expects(:ansible_report?).returns(true) assert_equal @importer.host, host end test 'creates new host if IP is not found' do ForemanAnsible::AnsibleReportScanner.expects(:ansible_report?).returns(true) assert @importer.host.new_record? end end
Version data entries
13 entries across 13 versions & 1 rubygems