class TestCallableConstraintValidation

Public Instance Methods

test_constraint_with_object_not_callable() click to toggle source
# File actionpack/test/dispatch/routing_test.rb, line 4606
def test_constraint_with_object_not_callable
  assert_raises(ArgumentError) do
    ActionDispatch::Routing::RouteSet.new.draw do
      ok = lambda { |env| [200, { "Content-Type" => "text/plain" }, []] }
      get "/test", to: ok, constraints: Object.new
    end
  end
end