diff options
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/mapper_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/mapper_test.rb b/actionpack/test/dispatch/mapper_test.rb index 9076dab0c0..3071890521 100644 --- a/actionpack/test/dispatch/mapper_test.rb +++ b/actionpack/test/dispatch/mapper_test.rb @@ -27,6 +27,10 @@ module ActionDispatch routes << args end + def defaults + routes.map { |x| x[3] } + end + def conditions routes.map { |x| x[1] } end @@ -48,6 +52,17 @@ module ActionDispatch end end + def test_random_keys + fakeset = FakeSet.new + mapper = Mapper.new fakeset + mapper.scope(omg: :awesome) do + mapper.get '/', :to => 'posts#index', :as => :main + end + assert_equal({:omg=>:awesome, :controller=>"posts", :action=>"index"}, + fakeset.defaults.first) + assert_equal ["GET"], fakeset.conditions.first[:request_method] + end + def test_mapping_requirements options = { } scope = Mapper::Scope.new({}) |