4138: code review feedback
[arvados.git] / apps / workbench / test / functional / pipeline_instances_controller_test.rb
index f3e1068e03cfaf6ba6af584b9e28fc50ce3d291b..a14d419e128525e829a25fa1471ff9f1d1be005a 100644 (file)
@@ -69,7 +69,7 @@ class PipelineInstancesControllerTest < ActionController::TestCase
       end
   end
 
-  test "component rendering copes with unexpeceted components format" do
+  test "component rendering copes with unexpected components format" do
     get(:show,
         {id: api_fixture("pipeline_instances")["components_is_jobspec"]["uuid"]},
         session_for(:active))
@@ -104,8 +104,24 @@ class PipelineInstancesControllerTest < ActionController::TestCase
          session_for(:active))
     assert_response 302
     assert_not_nil assigns(:object)
+
+    # Component 'foo' has script parameters only in the pipeline instance.
+    # Component 'bar' is present only in the pipeline_template.
+    # Test that the copied pipeline instance includes parameters for
+    # component 'foo' from the source instance, and parameters for
+    # component 'bar' from the source template.
+    #
     assert_not_nil assigns(:object).components[:foo]
+    foo = assigns(:object).components[:foo]
+    assert_not_nil foo[:script_parameters]
+    assert_not_nil foo[:script_parameters][:input]
+    assert_equal 'foo instance input', foo[:script_parameters][:input][:title]
+
     assert_not_nil assigns(:object).components[:bar]
+    bar = assigns(:object).components[:bar]
+    assert_not_nil bar[:script_parameters]
+    assert_not_nil bar[:script_parameters][:input]
+    assert_equal 'bar template input', bar[:script_parameters][:input][:title]
   end
 
   test "copy pipeline instance on newer template works with script=use_same" do
@@ -122,11 +138,9 @@ class PipelineInstancesControllerTest < ActionController::TestCase
     assert_response 302
     assert_not_nil assigns(:object)
 
-    # Component 'foo' has script parameters only in the pipeline instance.
-    # Component 'bar' is present only in the pipeline_template.
-    # Test that the copied pipeline instance includes parameters for
-    # component 'foo' from the source instance, and parameters for
-    # component 'bar' from the source template.
+    # Test that relevant component parameters were copied from both
+    # the source instance and source template, respectively (see
+    # previous test)
     #
     assert_not_nil assigns(:object).components[:foo]
     foo = assigns(:object).components[:foo]