Changeset 1505
- Timestamp:
- 06/25/05 10:58:44 (3 years ago)
- Files:
-
- trunk/actionpack/lib/action_controller/assertions.rb (modified) (3 diffs)
- trunk/actionpack/test/controller/test_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/lib/action_controller/assertions.rb
r1332 r1505 95 95 # Asserts that the routing of the given path is handled correctly and that the parsed options match. 96 96 def assert_recognizes(expected_options, path, extras={}, message=nil) 97 path = "/#{path}" unless path[0..0] == '/' 97 98 # Load routes.rb if it hasn't been loaded. 98 99 ActionController::Routing::Routes.reload if ActionController::Routing::Routes.empty? … … 106 107 extras.each_key { |key| expected_options.delete key } unless extras.nil? 107 108 109 expected_options.stringify_keys! 108 110 msg = build_message(message, "The recognized options <?> did not match <?>", 109 111 request.path_parameters, expected_options) … … 122 124 123 125 generated_path, found_extras = ActionController::Routing::Routes.generate(options, request) 124 generated_path = generated_path.join('/')125 126 msg = build_message(message, "found extras <?>, not <?>", found_extras, extras) 126 127 assert_block(msg) { found_extras == extras } trunk/actionpack/test/controller/test_test.rb
r1195 r1505 85 85 :only => { :tag => "li" } } } 86 86 end 87 88 def test_assert_routing 89 assert_generates 'controller/action/5', :controller => 'controller', :action => 'action', :id => '5' 90 end 87 91 end