Sha256: 23e6b478846f2198f370673c316f9f6ac3380e9dbff130f83a9caeb5a2b81d67
Contents?: true
Size: 1.49 KB
Versions: 19
Compression:
Stored size: 1.49 KB
Contents
require 'test_plugin_helper' describe TemplateInvocationInputValue do let(:template) { FactoryGirl.build(:job_template, :template => 'service restart <%= input("service_name") -%>') } let(:renderer) { InputTemplateRenderer.new(template) } let(:job_invocation) { FactoryGirl.create(:job_invocation) } let(:template_invocation) { FactoryGirl.build(:template_invocation, :template => template) } let(:result) { renderer.render } context 'with selectable options' do before do result # let is lazy template.template_inputs << FactoryGirl.build(:template_input, :name => 'service_name', :input_type => 'user', :required => true, :options => "foreman\nhttpd") end it 'fails with an invalid option' do refute_valid FactoryGirl.build(:template_invocation_input_value, :template_invocation => template_invocation, :template_input => template.template_inputs.first, :value => 'sendmail') end it 'succeeds with valid option' do assert_valid FactoryGirl.build(:template_invocation_input_value, :template_invocation => template_invocation, :template_input => template.template_inputs.first, :value => 'foreman') end end end
Version data entries
19 entries across 19 versions & 1 rubygems