Sha256: 0467a154e99db87ed1d6aa5c1189c958f20b3ac35cdb87d4482e407344580d1e

Contents?: true

Size: 1.05 KB

Versions: 30

Compression:

Stored size: 1.05 KB

Contents

require 'test_puppet_helper'

module ForemanPuppet
  class ConfigGroupInfoTest < ActiveSupport::TestCase
    let(:cg_info) { HostInfoProviders::ConfigGroupsInfo.new(host) }

    context 'with Puppet Host' do
      let(:config_group) { FactoryBot.create(:config_group) }
      let(:host) do
        FactoryBot.build(:host, :with_puppet_enc,
          location: taxonomies(:location1),
          organization: taxonomies(:organization1),
          operatingsystem: operatingsystems(:redhat),
          config_groups: [config_group])
      end

      it 'adds config_groups to host parameters' do
        assert_equal([config_group.name], cg_info.host_info['parameters']['foreman_config_groups'])
      end
    end

    context 'without Puppet' do
      let(:host) do
        FactoryBot.build(:host,
          location: taxonomies(:location1),
          organization: taxonomies(:organization1),
          operatingsystem: operatingsystems(:redhat))
      end

      it 'does not fail without puppet facet' do
        assert_empty(cg_info.host_info)
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
foreman_puppet-8.1.1 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-8.1.0 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-8.0.0 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-6.4.0 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-7.0.0 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-6.3.0 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-6.2.0 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-6.1.1 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-5.1.3 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-6.1.0 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-6.0.1 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-6.0.0 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-5.1.2 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-4.1.1 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-5.1.1 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-5.1.0 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-4.1.0 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-4.0.4 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-5.0.0 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-4.0.3 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb