[RESTORES BUILD] Added assert_recognizes to test_helper.rb, pending commit of Rails patch 638

This commit is contained in:
Alexey Verkhovsky 2005-02-19 13:58:27 +00:00
parent f389d84453
commit 1fa143f5d4

View file

@ -56,6 +56,23 @@ class Test::Unit::TestCase
ApplicationController.wiki = nil
end
# Checks that a given URI path is recognized as expected options
# Delete it when patch #638 is commiteed to Rails (http://dev.rubyonrails.org/ticket/638)
def assert_recognizes(expected_options, path)
# Load routes.rb if it hasn't been loaded.
ActionController::Routing::Routes.reload if ActionController::Routing::Routes.empty?
# Assume given controller
request = ActionController::TestRequest.new({}, {}, nil)
request.path = path
ActionController::Routing::Routes.recognize!(request)
msg = build_message(nil, "The recognized options <?> did not match <?>",
request.path_parameters, expected_options)
assert_block(msg) { request.path_parameters == expected_options }
end
end
class WikiServiceWithNoPersistence