X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/ea7c6effed14cd80a444c6e4d5b89c8b99c17d59..7b070fc8458f4108d44d6bfb939e36d3cc76af84:/services/api/test/integration/valid_links_test.rb?ds=sidebyside diff --git a/services/api/test/integration/valid_links_test.rb b/services/api/test/integration/valid_links_test.rb index 657bf02a09..1a98a65744 100644 --- a/services/api/test/integration/valid_links_test.rb +++ b/services/api/test/integration/valid_links_test.rb @@ -1,3 +1,7 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + require 'test_helper' class ValidLinksTest < ActionDispatch::IntegrationTest @@ -6,33 +10,39 @@ class ValidLinksTest < ActionDispatch::IntegrationTest test "tail must exist on update" do admin_auth = {'HTTP_AUTHORIZATION' => "OAuth2 #{api_client_authorizations(:admin).api_token}"} - post "/arvados/v1/links", { - :format => :json, - :link => { - link_class: 'test', - name: 'stuff', - head_uuid: users(:active).uuid, - tail_uuid: virtual_machines(:testvm).uuid - } - }, admin_auth + post "/arvados/v1/links", + params: { + :format => :json, + :link => { + link_class: 'test', + name: 'stuff', + head_uuid: users(:active).uuid, + tail_uuid: virtual_machines(:testvm).uuid + } + }, + headers: admin_auth assert_response :success - u = jresponse['uuid'] + u = json_response['uuid'] - put "/arvados/v1/links/#{u}", { - :format => :json, - :link => { - tail_uuid: virtual_machines(:testvm2).uuid - } - }, admin_auth + put "/arvados/v1/links/#{u}", + params: { + :format => :json, + :link => { + tail_uuid: virtual_machines(:testvm2).uuid + } + }, + headers: admin_auth assert_response :success assert_equal virtual_machines(:testvm2).uuid, (ActiveSupport::JSON.decode @response.body)['tail_uuid'] - put "/arvados/v1/links/#{u}", { - :format => :json, - :link => { - tail_uuid: 'zzzzz-tpzed-xyzxyzxerrrorxx' - } - }, admin_auth + put "/arvados/v1/links/#{u}", + params: { + :format => :json, + :link => { + tail_uuid: 'zzzzz-tpzed-xyzxyzxerrrorxx' + } + }, + headers: admin_auth assert_response 422 end