mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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
2 changed files with 12 additions and 1 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
8
actionpack/test/view/test_case_test.rb
Normal file
8
actionpack/test/view/test_case_test.rb
Normal file
|
@ -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 a new issue