1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
7 class ValidLinksTest < ActionDispatch::IntegrationTest
10 test "tail must exist on update" do
11 admin_auth = {'HTTP_AUTHORIZATION' => "OAuth2 #{api_client_authorizations(:admin).api_token}"}
13 post "/arvados/v1/links", {
18 head_uuid: users(:active).uuid,
19 tail_uuid: virtual_machines(:testvm).uuid
22 assert_response :success
23 u = json_response['uuid']
25 put "/arvados/v1/links/#{u}", {
28 tail_uuid: virtual_machines(:testvm2).uuid
31 assert_response :success
32 assert_equal virtual_machines(:testvm2).uuid, (ActiveSupport::JSON.decode @response.body)['tail_uuid']
34 put "/arvados/v1/links/#{u}", {
37 tail_uuid: 'zzzzz-tpzed-xyzxyzxerrrorxx'