From f9e2496872bcd34aa7c6083b1763322b47fba6a3 Mon Sep 17 00:00:00 2001 From: brainopia Date: Thu, 8 Jan 2015 02:53:57 +0300 Subject: Correct route requirements by overriding defaultls (fixes #18373) --- actionpack/test/journey/route_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'actionpack/test/journey/route_test.rb') diff --git a/actionpack/test/journey/route_test.rb b/actionpack/test/journey/route_test.rb index 21d867aca0..9616f036b3 100644 --- a/actionpack/test/journey/route_test.rb +++ b/actionpack/test/journey/route_test.rb @@ -25,6 +25,14 @@ module ActionDispatch end end + def test_path_requirements_override_defaults + strexp = Router::Strexp.build(':name', { name: /love/ }, ['/']) + path = Path::Pattern.new strexp + defaults = { name: 'tender' } + route = Route.new('name', nil, path, nil, defaults) + assert_equal /love/, route.requirements[:name] + end + def test_ip_address path = Path::Pattern.from_string '/messages/:id(.:format)' route = Route.new("name", nil, path, {:ip => '192.168.1.1'}, -- cgit v1.2.3