4000: tighten up functional test
authorTim Pierce <twp@curoverse.com>
Wed, 1 Oct 2014 18:28:38 +0000 (14:28 -0400)
committerTim Pierce <twp@curoverse.com>
Wed, 1 Oct 2014 18:28:38 +0000 (14:28 -0400)
Updated the test to ensure that a copied pipeline instance actually has
the expected script_parameters from both the source instance and source
template, respectively.

apps/workbench/test/functional/pipeline_instances_controller_test.rb
services/api/test/fixtures/pipeline_instances.yml
services/api/test/fixtures/pipeline_templates.yml

index 69d0664ef8735f2d4d88e23308458a3fe89ded4b..f3e1068e03cfaf6ba6af584b9e28fc50ce3d291b 100644 (file)
@@ -121,7 +121,23 @@ 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
 end
index 2ccfab7f76a2ec74ed3ad1b75d81006e16790904..a3d372bbca1a6add5c5504911ff8e1119298f3d2 100644 (file)
@@ -135,8 +135,11 @@ pipeline_with_newer_template:
   pipeline_template_uuid: zzzzz-p5p6p-vq4wuvy84xvaq2r
   created_at: 2014-09-15 12:00:00
   components:
-   foo:
-    script: foo
-    script_version: master
-    script_parameters:
-      input: foo_input
+    foo:
+      script: foo
+      script_version: master
+      script_parameters:
+        input:
+          required: true
+          dataclass: Collection
+          title: foo instance input
index bb825cf9a41e20fd1d05ce6b978d33efa13606b0..31ebb977dc25272a60d9d3580c265e5ef2d0e2ba 100644 (file)
@@ -89,15 +89,19 @@ new_pipeline_template:
   created_at: 2014-09-14 12:00:00
   modified_at: 2014-09-16 12:00:00
   components:
-   foo:
-    script: foo
-    script_version: master
-    script_parameters: {}
-   bar:
-    script: bar
-    script_version: master
-    script_parameters:
-      input:
-        required: true
-        dataclass: Collection
-        title: "bar input"
+    foo:
+      script: foo
+      script_version: master
+      script_parameters:
+        input:
+          required: true
+          dataclass: Collection
+          title: foo template input
+    bar:
+      script: bar
+      script_version: master
+      script_parameters:
+        input:
+          required: true
+          dataclass: Collection
+          title: bar template input