diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-23 10:57:15 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-23 10:57:25 -0700 |
commit | 0f5e3a9f6b8a5c292092fb73a5071af102242e57 (patch) | |
tree | da4b8565a96e73ae4c06f84e7a779cc6530aab17 /actionpack/test | |
parent | 6fd8346400f99c33cf207d422a22730427420dbb (diff) | |
download | rails-0f5e3a9f6b8a5c292092fb73a5071af102242e57.tar.gz rails-0f5e3a9f6b8a5c292092fb73a5071af102242e57.tar.bz2 rails-0f5e3a9f6b8a5c292092fb73a5071af102242e57.zip |
decouple the router object from the request class
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/journey/router_test.rb | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/actionpack/test/journey/router_test.rb b/actionpack/test/journey/router_test.rb index 0b3dd530a3..6252458861 100644 --- a/actionpack/test/journey/router_test.rb +++ b/actionpack/test/journey/router_test.rb @@ -12,18 +12,10 @@ module ActionDispatch def setup @app = StubDispatcher.new @routes = Routes.new - @router = Router.new(@routes, { - :request_class => ActionDispatch::Request - }) + @router = Router.new(@routes) @formatter = Formatter.new(@routes) end - def test_request_class_reader - klass = Object.new - router = Router.new(routes, :request_class => klass) - assert_equal klass, router.request_class - end - class FakeRequestFeeler < Struct.new(:env, :called) def new env self.env = env @@ -41,7 +33,7 @@ module ActionDispatch end def test_dashes - router = Router.new(routes, { :request_class => ActionDispatch::Request }) + router = Router.new(routes) exp = Router::Strexp.new '/foo-bar-baz', {}, ['/.?'] path = Path::Pattern.new exp @@ -57,7 +49,7 @@ module ActionDispatch end def test_unicode - router = Router.new(routes, { :request_class => ActionDispatch::Request }) + router = Router.new(routes) #match the escaped version of /ほげ exp = Router::Strexp.new '/%E3%81%BB%E3%81%92', {}, ['/.?'] @@ -75,7 +67,7 @@ module ActionDispatch def test_request_class_and_requirements_success klass = FakeRequestFeeler.new nil - router = Router.new(routes, {}) + router = Router.new(routes) requirements = { :hello => /world/ } @@ -95,7 +87,7 @@ module ActionDispatch def test_request_class_and_requirements_fail klass = FakeRequestFeeler.new nil - router = Router.new(routes, {}) + router = Router.new(routes) requirements = { :hello => /mom/ } @@ -124,7 +116,7 @@ module ActionDispatch end def test_request_class_overrides_path_info - router = Router.new(routes, {:request_class => CustomPathRequest }) + router = Router.new(routes) exp = Router::Strexp.new '/bar', {}, ['/.?'] path = Path::Pattern.new exp |