From 91f538bcafec781ddae426b28ce8abd939cc4a82 Mon Sep 17 00:00:00 2001 From: Martin Solli Date: Thu, 14 Oct 2010 16:27:10 +0200 Subject: [PATCH] Add test that really should fail for route in constraints block. --- actionpack/test/dispatch/routing_test.rb | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index 5c188a6..11e9825 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -58,6 +58,10 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest match 'account/overview' end + constraints(lambda { |req| false }) do + match 'account/yo' + end + match '/account/nested/overview' match 'sign_in' => "sessions#new" @@ -1447,6 +1451,12 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest end end + def test_assert_recognizes_with_class_constraints + with_test_routes do + assert_recognizes({:controller => "account", :action => "yo"}, :path => "/account/yo") + end + end + def test_resource_new_actions with_test_routes do assert_equal '/replies/new/preview', preview_new_reply_path -- 1.7.1