+ end
+
+ test "group contents with include trash collections" do
+ get "/arvados/v1/groups/contents", {
+ include_trash: "true",
+ filters: [["uuid", "is_a", "arvados#collection"]].to_json,
+ limit: 1000
+ }, auth(:active)
+ assert_response 200
+
+ coll_uuids = []
+ json_response['items'].each { |c| coll_uuids << c['uuid'] }
+ assert_includes coll_uuids, collections(:foo_collection_in_aproject).uuid
+ assert_includes coll_uuids, collections(:expired_collection).uuid
+ end
+
+ test "group contents without trash collections" do
+ get "/arvados/v1/groups/contents", {
+ filters: [["uuid", "is_a", "arvados#collection"]].to_json,
+ limit: 1000
+ }, auth(:active)
+ assert_response 200
+
+ coll_uuids = []
+ json_response['items'].each { |c| coll_uuids << c['uuid'] }
+ assert_includes coll_uuids, collections(:foo_collection_in_aproject).uuid
+ assert_not_includes coll_uuids, collections(:expired_collection).uuid
+ end
+end
+
+class NonTransactionalGroupsTest < ActionDispatch::IntegrationTest
+ # Transactional tests are disabled to be able to test the concurrent
+ # asynchronous permissions update feature.
+ # This is needed because nested transactions share the connection pool, so
+ # one thread is locked while trying to talk to the database, until the other
+ # one finishes.
+ #
+ # WARNING: Any test within this class should clean up the changes made in the
+ # database to avoid state leaks to other tests!
+ self.use_transactional_fixtures = false
+
+ test "create request with async=true defers permissions update" do
+ Rails.configuration.async_permissions_update_interval = 1 # second
+ name = "Random group #{rand(1000)}"
+ assert_equal nil, Group.find_by_name(name)