Sha256: d3e0a027ebf76a68514b72aab196fa46e4f1853ef074354c21240201957b13d7
Contents?: true
Size: 1.44 KB
Versions: 38
Compression:
Stored size: 1.44 KB
Contents
# frozen_string_literal: true require 'test_plugin_helper' class JobInvocationsControllerTest < ActionController::TestCase test 'should parse inputs coming from the URL params' do template = FactoryBot.create(:job_template, :with_input) feature = FactoryBot.create(:remote_execution_feature, :job_template => template) params = { feature: feature.label, inputs: { template.template_inputs.first.name => 'foobar' } } get :new, params: params, session: set_session_user template_invocation_params = [ { 'input_values' => [ { 'value' => 'foobar', 'template_input_id' => template.template_inputs.first.id } ], 'template_id' => template.id } ] assert_equal(template_invocation_params, assigns(:composer).params['template_invocations']) end test 'should allow no inputs' do template = FactoryBot.create(:job_template) feature = FactoryBot.create(:remote_execution_feature, :job_template => template) params = { feature: feature.label, } get :new, params: params, session: set_session_user template_invocation_params = [ { 'template_id' => template.id, 'input_values' => {} } ] assert_equal(template_invocation_params, assigns(:composer).params['template_invocations']) end end
Version data entries
38 entries across 38 versions & 1 rubygems