X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/6d324fb5962e8425393c921c2def4aa1506c7230..407f1cf196f60f4af21c89cbdccb2c98e05518fb:/apps/workbench/test/functional/pipeline_instances_controller_test.rb diff --git a/apps/workbench/test/functional/pipeline_instances_controller_test.rb b/apps/workbench/test/functional/pipeline_instances_controller_test.rb index 7f6068911c..20886b5ab6 100644 --- a/apps/workbench/test/functional/pipeline_instances_controller_test.rb +++ b/apps/workbench/test/functional/pipeline_instances_controller_test.rb @@ -2,6 +2,7 @@ require 'test_helper' class PipelineInstancesControllerTest < ActionController::TestCase def create_instance_long_enough_to(instance_attrs={}) + # create 'two_part' pipeline with the given instance attributes pt_fixture = api_fixture('pipeline_templates')['two_part'] post :create, { pipeline_instance: instance_attrs.merge({ @@ -12,7 +13,13 @@ class PipelineInstancesControllerTest < ActionController::TestCase assert_response :success pi_uuid = assigns(:object).uuid assert_not_nil assigns(:object) + + # yield yield pi_uuid, pt_fixture + + # delete the pipeline instance + use_token :active + PipelineInstance.where(uuid: pi_uuid).first.destroy end test "pipeline instance components populated after create" do @@ -68,4 +75,15 @@ class PipelineInstancesControllerTest < ActionController::TestCase session_for(:active)) assert_response :success end + + test "dates in JSON components are parsed" do + get(:show, + {id: api_fixture('pipeline_instances')['has_component_with_completed_jobs']['uuid']}, + session_for(:active)) + assert_response :success + assert_not_nil assigns(:object) + assert_not_nil assigns(:object).components[:foo][:job] + assert assigns(:object).components[:foo][:job][:started_at].is_a? Time + assert assigns(:object).components[:foo][:job][:finished_at].is_a? Time + end end