Sha256: cc5861a32d0ba6a43e0c795b131354c86b53ce16f89dcb01af415ea4e7e8cd11

Contents?: true

Size: 1.05 KB

Versions: 15

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_equal({}, cg_info.host_info)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
foreman_puppet-2.0.7 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-2.0.6 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-2.0.5 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-2.0.4 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-2.0.3 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-2.0.2 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-2.0.0 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-1.0.5 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-1.0.4 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-2.0.0.alpha.2 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-1.0.3 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-1.0.2 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-1.0.1 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-1.0.0 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
foreman_puppet-1.0.0.rc.2 test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb