Make sure named routes with parameters can be used in tests before a request has been done. [#1208 state:resolved]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
This commit is contained in:
Eloy Duran
2008-10-13 16:08:41 +02:00
committed by Pratik Naik
parent 1b44bbff42
commit b47c76b1df
2 changed files with 4 additions and 0 deletions

View File

@@ -134,6 +134,9 @@ module ActionController
@controller = self.class.controller_class.new
@controller.request = @request = TestRequest.new
@response = TestResponse.new
@controller.params = {}
@controller.send(:initialize_current_url)
end
# Cause the action to be rescued according to the regular rules for rescue_action when the visitor is not local

View File

@@ -667,6 +667,7 @@ class NamedRoutesControllerTest < ActionController::TestCase
with_routing do |set|
set.draw { |map| map.resources :contents }
assert_equal 'http://test.host/contents/new', new_content_url
assert_equal 'http://test.host/contents/1', content_url(:id => 1)
end
end
end