Skip to content

Commit

Permalink
Make sure named routes with parameters can be used in tests before a …
Browse files Browse the repository at this point in the history
…request has been done. [#1208 state:resolved]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
  • Loading branch information
alloy authored and lifo committed Oct 13, 2008
1 parent 1b44bbf commit b47c76b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions actionpack/lib/action_controller/test_case.rb
Expand Up @@ -134,6 +134,9 @@ def setup_controller_request_and_response
@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
Expand Down
1 change: 1 addition & 0 deletions actionpack/test/controller/test_test.rb
Expand Up @@ -667,6 +667,7 @@ def test_should_be_able_to_use_named_routes_before_a_request_is_done
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

0 comments on commit b47c76b

Please sign in to comment.