summaryrefslogtreecommitdiff
path: root/test/integration/routes/no_route_test.rb
blob: a570f85e9ef98ec80a8de9482e5c99d2005354c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require 'test_helper'

class NoRouteTest < ActionDispatch::IntegrationTest

  def test_path_with_dot
    assert_no_route '.viminfo'
  end

  def assert_no_route(path, options = {})
    options[:method] ||= :get
    path = "/#{path}" unless path.first == "/"
    params = @routes.recognize_path(path, method: :get)
    flunk "Expected no route to '#{path}' but found: #{params.inspect}"
  rescue ActionController::RoutingError
    pass
  end
end