mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user