3 class PipelineInstancesControllerTest < ActionController::TestCase
4 def create_instance_long_enough_to(instance_attrs={})
5 pt_fixture = api_fixture('pipeline_templates')['two_part']
7 pipeline_instance: instance_attrs.merge({
8 pipeline_template_uuid: pt_fixture['uuid']
11 }, session_for(:active)
12 assert_response :success
13 pi_uuid = assigns(:object).uuid
14 assert_not_nil assigns(:object)
15 yield pi_uuid, pt_fixture
18 test "pipeline instance components populated after create" do
19 create_instance_long_enough_to do |new_instance_uuid, template_fixture|
20 assert_equal(template_fixture['components'].to_json,
21 assigns(:object).components.to_json)
25 test "can render pipeline instance with tagged collections" do
26 # Make sure to pass in a tagged collection to test that part of the rendering behavior.
28 {id: api_fixture("pipeline_instances")["pipeline_with_tagged_collection_input"]["uuid"]},
30 assert_response :success
33 test "update script_parameters one at a time using merge param" do
34 template_fixture = api_fixture('pipeline_templates')['two_part']
36 id: api_fixture("pipeline_instances")["pipeline_to_merge_params"]["uuid"],
53 }, session_for(:active)
54 assert_response :success
55 assert_not_nil assigns(:object)
56 orig_params = template_fixture['components']['part-two']['script_parameters']
57 new_params = assigns(:object).components[:'part-two'][:script_parameters]
58 orig_params.keys.each do |k|
59 unless %w(integer_with_value plain_string).index(k)
60 assert_equal orig_params[k].to_json, new_params[k.to_sym].to_json
65 test "component rendering copes with unexpeceted components format" do
67 {id: api_fixture("pipeline_instances")["components_is_jobspec"]["uuid"]},
69 assert_response :success