9898: add unlock method also on the container model.
[arvados.git] / services / api / test / functional / arvados / v1 / pipeline_instances_controller_test.rb
index d1e615663235d0940ae24ca2ad564ee0f9b0f227..63c47ff407ae86b45927804a1c764d449206d616 100644 (file)
@@ -1,4 +1,28 @@
 require 'test_helper'
 
 class Arvados::V1::PipelineInstancesControllerTest < ActionController::TestCase
+
+  test 'create pipeline with components copied from template' do
+    authorize_with :active
+    post :create, {
+      pipeline_instance: {
+        pipeline_template_uuid: pipeline_templates(:two_part).uuid
+      }
+    }
+    assert_response :success
+    assert_equal(pipeline_templates(:two_part).components.to_json,
+                 assigns(:object).components.to_json)
+  end
+
+  test 'create pipeline with no template' do
+    authorize_with :active
+    post :create, {
+      pipeline_instance: {
+        components: {}
+      }
+    }
+    assert_response :success
+    assert_equal({}, assigns(:object).components)
+  end
+
 end