X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/135f306e75cb61e1153b3590b71c32ef497404ed..1a599ec69ad8d533da1f12ad5d2c5789aa1c14e2:/services/api/test/integration/serialized_encoding_test.rb?ds=sidebyside diff --git a/services/api/test/integration/serialized_encoding_test.rb b/services/api/test/integration/serialized_encoding_test.rb index 10b94351a6..f41c033b39 100644 --- a/services/api/test/integration/serialized_encoding_test.rb +++ b/services/api/test/integration/serialized_encoding_test.rb @@ -1,27 +1,35 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + require 'test_helper' +require 'helpers/git_test_helper' class SerializedEncodingTest < ActionDispatch::IntegrationTest + include GitTestHelper + fixtures :all - test "store json-encoded link with properties hash" do - post "/arvados/v1/links", { - :link => { - :link_class => 'test', - :name => 'test', - :properties => {:foo => :bar} - }.to_json, - :format => :json - }, auth(:active) - assert_response :success - end + { + api_client_authorization: {scopes: []}, + + human: {properties: {eye_color: 'gray'}}, + + link: {link_class: 'test', name: 'test', properties: {foo: :bar}}, + + node: {info: {uptime: 1234}}, + + specimen: {properties: {eye_color: 'meringue'}}, + + trait: {properties: {eye_color: 'brown'}}, - test "store json-encoded pipeline instance with components_summary hash" do - post "/arvados/v1/pipeline_instances", { - :pipeline_instance => { - :components_summary => {:todo => 0} - }.to_json, - :format => :json - }, auth(:active) - assert_response :success + user: {prefs: {cookies: 'thin mint'}}, + }.each_pair do |resource, postdata| + test "create json-encoded #{resource.to_s}" do + post("/arvados/v1/#{resource.to_s.pluralize}", + params: {resource => postdata.to_json}, + headers: auth(:admin_trustedclient)) + assert_response :success + end end end