1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
6 require 'helpers/git_test_helper'
8 class SerializedEncodingTest < ActionDispatch::IntegrationTest
14 api_client_authorization: {scopes: []},
16 human: {properties: {eye_color: 'gray'}},
19 repository: 'active/foo',
20 runtime_constraints: {docker_image: 'arvados/apitestfixture'},
22 script_version: 'master',
23 script_parameters: {pattern: 'foobar'},
24 tasks_summary: {todo: 0},
27 job_task: {parameters: {pattern: 'foo'}},
29 link: {link_class: 'test', name: 'test', properties: {foo: :bar}},
31 node: {info: {uptime: 1234}},
34 components: {"job1" => {parameters: {pattern: "xyzzy"}}},
35 components_summary: {todo: 0},
36 properties: {test: true},
40 components: {"job1" => {parameters: {pattern: "xyzzy"}}},
43 specimen: {properties: {eye_color: 'meringue'}},
45 trait: {properties: {eye_color: 'brown'}},
47 user: {prefs: {cookies: 'thin mint'}},
48 }.each_pair do |resource, postdata|
49 test "create json-encoded #{resource.to_s}" do
50 post("/arvados/v1/#{resource.to_s.pluralize}",
51 {resource => postdata.to_json}, auth(:admin_trustedclient))
52 assert_response :success