Sha256: af8bdd9aa1db882adbe82e0154a73f4c178f3c9a6dffb20e301317cd9ceaac96

Contents?: true

Size: 1.08 KB

Versions: 16

Compression:

Stored size: 1.08 KB

Contents

require 'test_plugin_helper'

class TemplateInputTest < ActiveSupport::TestCase
  let(:template_input) { FactoryBot.build(:template_input) }

  context 'export' do
    before do
      template_input.input_type = 'user'
      template_input.options = "foo\nbar\nbaz"
    end

    it 'exports type' do
      template_input.to_export['input_type'].must_equal template_input.input_type
    end

    it 'exports options' do
      template_input.to_export['options'].must_equal template_input.options
    end
  end

  context 'user input' do
    before { template_input.input_type = 'user' }
    it { assert template_input.user_template_input? }
  end

  context 'fact input' do
    before { template_input.input_type = 'fact' }
    it { assert template_input.fact_template_input? }
  end

  context 'variable input' do
    before { template_input.input_type = 'variable' }
    it { assert template_input.variable_template_input? }
  end

  context 'puppet parameter input' do
    before { template_input.input_type = 'puppet_parameter' }
    it { assert template_input.puppet_parameter_template_input? }
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
foreman_remote_execution-1.5.6 test/unit/template_input_test.rb
foreman_remote_execution-1.6.3 test/unit/template_input_test.rb
foreman_remote_execution-1.6.2 test/unit/template_input_test.rb
foreman_remote_execution-1.5.5 test/unit/template_input_test.rb
foreman_remote_execution-1.6.1 test/unit/template_input_test.rb
foreman_remote_execution-1.6.0 test/unit/template_input_test.rb
foreman_remote_execution-1.5.4 test/unit/template_input_test.rb
foreman_remote_execution-1.5.3 test/unit/template_input_test.rb
foreman_remote_execution-1.5.2 test/unit/template_input_test.rb
foreman_remote_execution-1.5.1 test/unit/template_input_test.rb
foreman_remote_execution-1.5.0 test/unit/template_input_test.rb
foreman_remote_execution-1.4.6 test/unit/template_input_test.rb
foreman_remote_execution-1.4.5 test/unit/template_input_test.rb
foreman_remote_execution-1.4.4 test/unit/template_input_test.rb
foreman_remote_execution-1.4.3 test/unit/template_input_test.rb
foreman_remote_execution-1.4.2 test/unit/template_input_test.rb