1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
7 class DatabaseControllerTest < ActionController::TestCase
8 include CurrentApiClient
10 test "reset fails with non-admin token" do
11 authorize_with :active
16 test "route not found when not in test mode" do
20 Rails.env = 'production'
21 Rails.application.reload_routes!
22 assert_raises ActionController::UrlGenerationError do
27 Rails.application.reload_routes!
31 test "reset fails when a non-test-fixture user exists" do
33 User.create!(uuid: 'abcde-tpzed-123451234512345', email: 'bar@example.net')
40 test "reset succeeds with admin token" do
43 new_uuid = Specimen.create.uuid
45 assert_not_empty Specimen.where(uuid: new_uuid)
49 assert_empty Specimen.where(uuid: new_uuid)