8784: Fix test for latest firefox.
[arvados.git] / services / api / test / integration / errors_test.rb
1 require 'test_helper'
2
3 class ErrorsTest < ActionDispatch::IntegrationTest
4   fixtures :api_client_authorizations
5
6   %w(/arvados/v1/shoes /arvados/shoes /shoes /nodes /users).each do |path|
7     test "non-existent route #{path}" do
8       get path, {:format => :json}, auth(:active)
9       assert_nil assigns(:objects)
10       assert_nil assigns(:object)
11       assert_not_nil json_response['errors']
12       assert_response 404
13     end
14   end
15
16   n=0
17   Rails.application.routes.routes.each do |route|
18     test "route #{n += 1} '#{route.path.spec.to_s}' is not an accident" do
19       # Generally, new routes should appear under /arvados/v1/. If
20       # they appear elsewhere, that might have been caused by default
21       # rails generator behavior that we don't want.
22       assert_match(/^\/(|\*a|arvados\/v1\/.*|auth\/.*|login|logout|database\/reset|discovery\/.*|static\/.*|themes\/.*|assets)(\(\.:format\))?$/,
23                    route.path.spec.to_s,
24                    "Unexpected new route: #{route.path.spec}")
25     end
26   end
27 end