X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0f644e242ef37c911ad3dc25aca8135c339de349..4139c5dfde60cdd20d39f385ca36107b0c44906f:/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 51a6ff3ba8..c390a02c04 100644 --- a/services/api/test/unit/api_client_authorization_test.rb +++ b/services/api/test/unit/api_client_authorization_test.rb @@ -3,6 +3,7 @@ # SPDX-License-Identifier: AGPL-3.0 require 'test_helper' +require 'sweep_trashed_objects' class ApiClientAuthorizationTest < ActiveSupport::TestCase include CurrentApiClient @@ -18,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