1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
7 class ErrorsTest < ActionDispatch::IntegrationTest
8 fixtures :api_client_authorizations
10 %w(/arvados/v1/shoes /arvados/shoes /shoes /nodes /users).each do |path|
11 test "non-existent route #{path}" do
12 get path, {:format => :json}, auth(:active)
13 assert_nil assigns(:objects)
14 assert_nil assigns(:object)
15 assert_not_nil json_response['errors']
21 Rails.application.routes.routes.each do |route|
22 test "route #{n += 1} '#{route.path.spec.to_s}' is not an accident" do
23 # Generally, new routes should appear under /arvados/v1/. If
24 # they appear elsewhere, that might have been caused by default
25 # rails generator behavior that we don't want.
26 assert_match(/^\/(|\*a|arvados\/v1\/.*|auth\/.*|login|logout|database\/reset|discovery\/.*|static\/.*|themes\/.*|assets|_health\/.*)(\(\.:format\))?$/,
28 "Unexpected new route: #{route.path.spec}")