Sha256: 5ac9810aa1cec83430a52056cb71dab151706238880f300641f517082bce8bc1
Contents?: true
Size: 929 Bytes
Versions: 47
Compression:
Stored size: 929 Bytes
Contents
require 'test_plugin_helper' class ForemanRhCloudSelfHostTest < ActiveSupport::TestCase setup do # reset cached value ForemanRhCloud.instance_variable_set(:@foreman_host, nil) end test 'finds host by fullname' do @domain @host = FactoryBot.create(:host, :managed) ForemanRhCloud.expects(:foreman_host_name).returns(@host.name) actual = ForemanRhCloud.foreman_host assert_not_nil actual end test 'finds host by shortname' do @host = FactoryBot.create(:host, :managed) Host.where(name: @host.name).update_all(name: @host.shortname) ForemanRhCloud.expects(:foreman_host_name).returns(@host.name) actual = ForemanRhCloud.foreman_host assert_not_nil actual end test 'finds host by infrastructure facet' do @host = FactoryBot.create(:host, :managed, :with_infrastructure_facet) actual = ForemanRhCloud.foreman_host assert_equal @host, actual end end
Version data entries
47 entries across 47 versions & 1 rubygems