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'}},
18 link: {link_class: 'test', name: 'test', properties: {foo: :bar}},
20 node: {info: {uptime: 1234}},
22 specimen: {properties: {eye_color: 'meringue'}},
24 trait: {properties: {eye_color: 'brown'}},
26 user: {prefs: {cookies: 'thin mint'}},
27 }.each_pair do |resource, postdata|
28 test "create json-encoded #{resource.to_s}" do
29 post("/arvados/v1/#{resource.to_s.pluralize}",
30 params: {resource => postdata.to_json},
31 headers: auth(:admin_trustedclient))
32 assert_response :success