X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/19ae770973482257117fe8ded5619c3018c4b60f..1346cc5072843797a8091cd67a0eb75499a97642:/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