diff options
author | José Valim <jose.valim@gmail.com> | 2011-05-17 10:58:06 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-05-17 10:58:06 -0700 |
commit | f1e1e7658bbee698a75219b4c9d5e24a62220426 (patch) | |
tree | e611e213e162041b213cb836046afa3c1294cccc /actionpack/lib/action_controller/test_case.rb | |
parent | f627da15f4b30bfaa43c9a1374e082e97c6fc50b (diff) | |
parent | 13950a8cc94ab93bb20976f2797b1df9740849b3 (diff) | |
download | rails-f1e1e7658bbee698a75219b4c9d5e24a62220426.tar.gz rails-f1e1e7658bbee698a75219b4c9d5e24a62220426.tar.bz2 rails-f1e1e7658bbee698a75219b4c9d5e24a62220426.zip |
Merge pull request #1090 from dchelimsky/issue-1089
3.1: params_wrapper raises error on anynomous controllers
Diffstat (limited to 'actionpack/lib/action_controller/test_case.rb')
-rw-r--r-- | actionpack/lib/action_controller/test_case.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index 0085f542aa..5e4b48a531 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -413,7 +413,11 @@ module ActionController @request.env['REQUEST_METHOD'] = http_method parameters ||= {} - @request.assign_parameters(@routes, @controller.class.name.underscore.sub(/_controller$/, ''), action.to_s, parameters) + controller_class_name = @controller.class.name ? + @controller.class.name.underscore.sub(/_controller$/, '') : + "anonymous_controller" + + @request.assign_parameters(@routes, controller_class_name, action.to_s, parameters) @request.session = ActionController::TestSession.new(session) if session @request.session["flash"] = @request.flash.update(flash || {}) |