Namespace
Methods
- T
-
- test_initialize,
- test_map_more_slashes,
- test_map_slash,
- test_map_wildcard,
- test_map_wildcard_with_format_false,
- test_map_wildcard_with_format_true,
- test_map_wildcard_with_multiple_wildcard,
- test_map_wildcard_with_other_element,
- test_mapping_requirements,
- test_raising_helpful_error_on_invalid_arguments
Instance Public methods
test_initialize()
Link
test_map_more_slashes()
Link
# File actionpack/test/dispatch/mapper_test.rb, line 53 def test_map_more_slashes fakeset = FakeSet.new mapper = Mapper.new fakeset # FIXME: is this a desired behavior? mapper.get '/one/two/', :to => 'posts#index', :as => :main assert_equal '/one/two(.:format)', fakeset.conditions.first[:path_info] end
test_map_slash()
Link
test_map_wildcard()
Link
# File actionpack/test/dispatch/mapper_test.rb, line 62 def test_map_wildcard fakeset = FakeSet.new mapper = Mapper.new fakeset mapper.get '/*path', :to => 'pages#show' assert_equal '/*path(.:format)', fakeset.conditions.first[:path_info] assert_equal(/.+?/, fakeset.requirements.first[:path]) end
test_map_wildcard_with_format_false()
Link
# File actionpack/test/dispatch/mapper_test.rb, line 87 def test_map_wildcard_with_format_false fakeset = FakeSet.new mapper = Mapper.new fakeset mapper.get '/*path', :to => 'pages#show', :format => false assert_equal '/*path', fakeset.conditions.first[:path_info] assert_nil fakeset.requirements.first[:path] end
test_map_wildcard_with_format_true()
Link
test_map_wildcard_with_multiple_wildcard()
Link
# File actionpack/test/dispatch/mapper_test.rb, line 78 def test_map_wildcard_with_multiple_wildcard fakeset = FakeSet.new mapper = Mapper.new fakeset mapper.get '/*foo/*bar', :to => 'pages#show' assert_equal '/*foo/*bar(.:format)', fakeset.conditions.first[:path_info] assert_equal(/.+?/, fakeset.requirements.first[:foo]) assert_equal(/.+?/, fakeset.requirements.first[:bar]) end
test_map_wildcard_with_other_element()
Link
# File actionpack/test/dispatch/mapper_test.rb, line 70 def test_map_wildcard_with_other_element fakeset = FakeSet.new mapper = Mapper.new fakeset mapper.get '/*path/foo/:bar', :to => 'pages#show' assert_equal '/*path/foo/:bar(.:format)', fakeset.conditions.first[:path_info] assert_equal(/.+?/, fakeset.requirements.first[:path]) end
test_mapping_requirements()
Link
# File actionpack/test/dispatch/mapper_test.rb, line 39 def test_mapping_requirements options = { :controller => 'foo', :action => 'bar', :via => :get } m = Mapper::Mapping.build({}, FakeSet.new, '/store/:name(*rest)', nil, options) _, _, requirements, _ = m.to_route assert_equal(/.+?/, requirements[:rest]) end
test_raising_helpful_error_on_invalid_arguments()
Link