X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f4ca9ad94a6bb006d1f3c7ba207837f1736d1247..bc14c62ad1528dbddc26781c5cea6a7968c93f2e:/services/api/test/unit/api_client_authorization_test.rb diff --git a/services/api/test/unit/api_client_authorization_test.rb b/services/api/test/unit/api_client_authorization_test.rb index dd255fb0e0..c390a02c04 100644 --- a/services/api/test/unit/api_client_authorization_test.rb +++ b/services/api/test/unit/api_client_authorization_test.rb @@ -1,4 +1,9 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + require 'test_helper' +require 'sweep_trashed_objects' class ApiClientAuthorizationTest < ActiveSupport::TestCase include CurrentApiClient @@ -14,4 +19,11 @@ class ApiClientAuthorizationTest < ActiveSupport::TestCase assert_empty ApiClientAuthorization.where(api_token: newtoken), "Destroyed ApiClientAuth is still in database" end end + + test "delete expired in SweepTrashedObjects" do + assert_not_empty ApiClientAuthorization.where(uuid: api_client_authorizations(:expired).uuid) + SweepTrashedObjects.sweep_now + assert_empty ApiClientAuthorization.where(uuid: api_client_authorizations(:expired).uuid) + end + end