From 54dc69a87762ae17c1b0d72464611640589d2e44 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Thu, 27 Feb 2020 11:58:48 -0500 Subject: [PATCH] 15954: Fix test. The following "setup user" call was only succeeding because the "uuid" param was being ignored and the call was processed as a no-op ("admin account is already set up, nothing to do"). Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- services/api/test/integration/users_test.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/services/api/test/integration/users_test.rb b/services/api/test/integration/users_test.rb index ee230d5140..4be89a2455 100644 --- a/services/api/test/integration/users_test.rb +++ b/services/api/test/integration/users_test.rb @@ -326,7 +326,7 @@ class UsersTest < ActionDispatch::IntegrationTest end - test "cannot set is_activate to false directly" do + test "cannot set is_active to false directly" do post('/arvados/v1/users', params: { user: { @@ -339,6 +339,14 @@ class UsersTest < ActionDispatch::IntegrationTest user = json_response assert_equal false, user['is_active'] + token = act_as_system_user do + ApiClientAuthorization.create!(user: User.find_by_uuid(user['uuid']), api_client: ApiClient.all.first).api_token + end + post("/arvados/v1/user_agreements/sign", + params: {uuid: 'zzzzz-4zz18-t68oksiu9m80s4y'}, + headers: {"HTTP_AUTHORIZATION" => "Bearer #{token}"}) + assert_response :success + post("/arvados/v1/users/#{user['uuid']}/activate", params: {}, headers: auth(:admin)) -- 2.30.2