X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/64fc7012a9e0c28e441415759d780e1a78b26e67..100c0763a0d94e944eb24b7a2900b6e58e2cd516:/services/api/test/test_helper.rb diff --git a/services/api/test/test_helper.rb b/services/api/test/test_helper.rb index a5bd142b90..c6ea0b320f 100644 --- a/services/api/test/test_helper.rb +++ b/services/api/test/test_helper.rb @@ -2,6 +2,8 @@ # # SPDX-License-Identifier: AGPL-3.0 +require 'refresh_permission_view' + ENV["RAILS_ENV"] = "test" unless ENV["NO_COVERAGE_TEST"] begin @@ -60,11 +62,6 @@ class ActiveSupport::TestCase include ArvadosTestSupport include CurrentApiClient - setup do - ActiveRecord::Base.connection.execute("DELETE FROM #{TRASHED_GROUPS}") - ActiveRecord::Base.connection.execute("INSERT INTO #{TRASHED_GROUPS} select * from compute_trashed()") - end - teardown do Thread.current[:api_client_ip_address] = nil Thread.current[:api_client_authorization] = nil @@ -212,4 +209,6 @@ class ActionDispatch::IntegrationTest end # Ensure permissions are computed from the test fixtures. -User.invalidate_permissions_cache +do_refresh_permission_view +ActiveRecord::Base.connection.execute("DELETE FROM #{TRASHED_GROUPS}") +ActiveRecord::Base.connection.execute("INSERT INTO #{TRASHED_GROUPS} select * from compute_trashed()")