Sha256: cf368a1da0ef96476ec6e5a85eecfbdb57a72dc22458fd0c509062326ae4c63a

Contents?: true

Size: 1.08 KB

Versions: 8

Compression:

Stored size: 1.08 KB

Contents

require 'test_plugin_helper'

class TemplateInputTest < ActiveSupport::TestCase
  let(:template_input) { FactoryGirl.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

8 entries across 8 versions & 1 rubygems

Version Path
foreman_remote_execution-1.3.7 test/unit/template_input_test.rb
foreman_remote_execution-1.3.6 test/unit/template_input_test.rb
foreman_remote_execution-1.4.1 test/unit/template_input_test.rb
foreman_remote_execution-1.3.5 test/unit/template_input_test.rb
foreman_remote_execution-1.3.4 test/unit/template_input_test.rb
foreman_remote_execution-1.3.3 test/unit/template_input_test.rb
foreman_remote_execution-1.3.2 test/unit/template_input_test.rb
foreman_remote_execution-1.3.1 test/unit/template_input_test.rb