3 class DatabaseControllerTest < ActionController::TestCase
4 include CurrentApiClient
6 test "reset fails with non-admin token" do
12 test "route not found when not in test mode" do
16 Rails.env = 'production'
17 Rails.application.reload_routes!
18 assert_raises ActionController::RoutingError do
23 Rails.application.reload_routes!
27 test "reset fails when a non-test-fixture user exists" do
29 User.create!(uuid: 'abcde-tpzed-123451234512345', email: 'bar@example.net')
36 test "reset succeeds with admin token" do
39 new_uuid = Specimen.create.uuid
41 assert_not_empty Specimen.where(uuid: new_uuid)
45 assert_empty Specimen.where(uuid: new_uuid)