Skip to content

Commit

Permalink
Fixed ActionView::TestCase current url context [#1561 state:resolved]
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Peek <josh@joshpeek.com>
  • Loading branch information
Dan Pickett authored and josh committed Dec 15, 2008
1 parent 07326b3 commit 38412ec
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion actionpack/lib/action_view/test_case.rb
Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions actionpack/test/view/test_case_test.rb
@@ -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.