Permalink
Browse files

Fixed ActionView::TestCase current url context [#1561 state:resolved]

Signed-off-by: Joshua Peek <josh@joshpeek.com>
  • Loading branch information...
1 parent 07326b3 commit 38412ecb5daa1826574ad0f132d23dc2ef4288bf Dan Pickett committed with josh Dec 15, 2008
Showing with 12 additions and 1 deletion.
  1. +4 −1 actionpack/lib/action_view/test_case.rb
  2. +8 −0 actionpack/test/view/test_case_test.rb
@@ -60,11 +60,14 @@ def setup_with_helper_class
end
class TestController < ActionController::Base
- attr_accessor :request, :response
+ attr_accessor :request, :response, :params
def initialize
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
+
+ @params = {}
+ send(:initialize_current_url)
end
end
@@ -0,0 +1,8 @@
+require 'abstract_unit'
+
+class TestCaseTest < ActionView::TestCase
+ def test_should_have_current_url
+ controller = TestController.new
+ assert_nothing_raised(NoMethodError){ controller.url_for({:controller => "foo", :action => "index"}) }
+ end
+end

0 comments on commit 38412ec

Please sign in to comment.