diff options
author | Abdelkader Boudih <terminale@gmail.com> | 2015-10-27 00:41:27 +0000 |
---|---|---|
committer | eileencodes <eileencodes@gmail.com> | 2015-12-15 15:19:16 -0500 |
commit | 98a039dcd987fd3a8c2c0cbd527c71ac3ffaaf06 (patch) | |
tree | 9a9c694ad27af05f600a74d58d8727ac795a2b85 /railties/lib/rails/generators/test_unit/controller/templates | |
parent | f8edd2043e864aff0bde9289da550709532268a6 (diff) | |
download | rails-98a039dcd987fd3a8c2c0cbd527c71ac3ffaaf06.tar.gz rails-98a039dcd987fd3a8c2c0cbd527c71ac3ffaaf06.tar.bz2 rails-98a039dcd987fd3a8c2c0cbd527c71ac3ffaaf06.zip |
Update test generators to use ActionDispatch::IntegrationTest
In Rails 5.1 `ActionController::TestCase` will be moved out of Rails
into it's own gem. Please use `ActionDispatch::IntegrationTest` going
forward.
This changes the generators to use `ActionDispatch::IntegrationTest` and
the required URL setup (rather than symbols) for each of the controller
actions.
Updated fix to #22076.
Diffstat (limited to 'railties/lib/rails/generators/test_unit/controller/templates')
-rw-r--r-- | railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb b/railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb index 5a8a3ca5e0..4f2ceb8589 100644 --- a/railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb +++ b/railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb @@ -1,11 +1,9 @@ require 'test_helper' <% module_namespacing do -%> -class <%= class_name %>ControllerTest < ActionController::TestCase +class <%= class_name %>ControllerTest < ActionDispatch::IntegrationTest <% if mountable_engine? -%> - setup do - @routes = Engine.routes - end + include Engine.routes.url_helpers <% end -%> <% if actions.empty? -%> @@ -15,7 +13,7 @@ class <%= class_name %>ControllerTest < ActionController::TestCase <% else -%> <% actions.each do |action| -%> test "should get <%= action %>" do - get :<%= action %> + get <%= file_name %>_<%= action %>_url assert_response :success end |