mirror of https://github.com/rails/rails
Fixed ActionView::TestCase current url context [#1561 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
This commit is contained in:
parent
07326b38ec
commit
38412ecb5d
|
@ -60,11 +60,14 @@ module ActionView
|
||||||
end
|
end
|
||||||
|
|
||||||
class TestController < ActionController::Base
|
class TestController < ActionController::Base
|
||||||
attr_accessor :request, :response
|
attr_accessor :request, :response, :params
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@request = ActionController::TestRequest.new
|
@request = ActionController::TestRequest.new
|
||||||
@response = ActionController::TestResponse.new
|
@response = ActionController::TestResponse.new
|
||||||
|
|
||||||
|
@params = {}
|
||||||
|
send(:initialize_current_url)
|
||||||
end
|
end
|
||||||
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
|
Loading…
Reference in New Issue