Sha256: 0361aaafbd4565d00f0b95ff003d5052a625edad65fbae2be185ea419463617d

Contents?: true

Size: 736 Bytes

Versions: 28

Compression:

Stored size: 736 Bytes

Contents

require 'test_puppet_helper'

module ForemanPuppet
  class TemplateRenderingTest < ActiveSupport::TestCase
    let(:host) { FactoryBot.build_stubbed(:host, :with_puppet_enc) }
    let(:template) { stub(name: 'Test', template: 'Test') }
    let(:source) { Foreman::Renderer::Source::Database.new(template) }
    let(:scope) do
      Class.new(Foreman::Renderer::Scope::Base) do
        include Foreman::Renderer::Scope::Macros::HostTemplate
      end.send(:new, host: host, source: source)
    end

    describe '#host_puppet_classes' do
      test 'should render puppetclasses using host_puppetclasses helper' do
        assert_equal host.puppet.puppetclasses.pluck(:id), scope.host_puppet_classes.map(&:id)
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
foreman_puppet-8.0.0 test/unit/foreman_puppet/template_rendering_test.rb
foreman_puppet-6.4.0 test/unit/foreman_puppet/template_rendering_test.rb
foreman_puppet-7.0.0 test/unit/foreman_puppet/template_rendering_test.rb
foreman_puppet-6.3.0 test/unit/foreman_puppet/template_rendering_test.rb
foreman_puppet-6.2.0 test/unit/foreman_puppet/template_rendering_test.rb
foreman_puppet-6.1.1 test/unit/foreman_puppet/template_rendering_test.rb
foreman_puppet-5.1.3 test/unit/foreman_puppet/template_rendering_test.rb
foreman_puppet-6.1.0 test/unit/foreman_puppet/template_rendering_test.rb
foreman_puppet-6.0.1 test/unit/foreman_puppet/template_rendering_test.rb
foreman_puppet-6.0.0 test/unit/foreman_puppet/template_rendering_test.rb
foreman_puppet-5.1.2 test/unit/foreman_puppet/template_rendering_test.rb
foreman_puppet-4.1.1 test/unit/foreman_puppet/template_rendering_test.rb
foreman_puppet-5.1.1 test/unit/foreman_puppet/template_rendering_test.rb
foreman_puppet-5.1.0 test/unit/foreman_puppet/template_rendering_test.rb
foreman_puppet-4.1.0 test/unit/foreman_puppet/template_rendering_test.rb
foreman_puppet-4.0.4 test/unit/foreman_puppet/template_rendering_test.rb
foreman_puppet-5.0.0 test/unit/foreman_puppet/template_rendering_test.rb
foreman_puppet-4.0.3 test/unit/foreman_puppet/template_rendering_test.rb
foreman_puppet-4.0.2 test/unit/foreman_puppet/template_rendering_test.rb
foreman_puppet-3.0.7 test/unit/foreman_puppet/template_rendering_test.rb