3 class DatabaseControllerTest < ActionController::TestCase
4 include CurrentApiClient
8 # We made configuration changes here that affect routing.
9 Rails.application.reload_routes!
12 test "reset fails with non-admin token" do
13 authorize_with :active
18 test "reset fails when not in test mode" do
22 Rails.env = 'development'
30 test "reset fails when not configured" do
31 Rails.configuration.enable_remote_database_reset = false
32 Rails.application.reload_routes!
34 assert_raise ActionController::RoutingError do
39 test "reset succeeds with admin token" do
42 new_uuid = Specimen.create.uuid
44 assert_not_empty Specimen.where(uuid: new_uuid)
48 assert_empty Specimen.where(uuid: new_uuid)