15516: Merge branch 'master' into 15516-fix-arvados-server-dependencies
[arvados.git] / services / api / test / integration / serialized_encoding_test.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 require 'test_helper'
6 require 'helpers/git_test_helper'
7
8 class SerializedEncodingTest < ActionDispatch::IntegrationTest
9   include GitTestHelper
10
11   fixtures :all
12
13   {
14     api_client_authorization: {scopes: []},
15
16     human: {properties: {eye_color: 'gray'}},
17
18     link: {link_class: 'test', name: 'test', properties: {foo: :bar}},
19
20     node: {info: {uptime: 1234}},
21
22     specimen: {properties: {eye_color: 'meringue'}},
23
24     trait: {properties: {eye_color: 'brown'}},
25
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
33     end
34   end
35 end