diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2015-05-05 22:40:16 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2015-05-31 12:54:38 +0900 |
commit | 6a8d91897bae19f5d30f51a2731d9bbf7f41ac2e (patch) | |
tree | 42b728bd5c4172cbaf6285bd0dec74516852619a /railties/lib/rails/generators | |
parent | 0b34b79d648e2f10e91ca280e38a5f18af3c7134 (diff) | |
download | rails-6a8d91897bae19f5d30f51a2731d9bbf7f41ac2e.tar.gz rails-6a8d91897bae19f5d30f51a2731d9bbf7f41ac2e.tar.bz2 rails-6a8d91897bae19f5d30f51a2731d9bbf7f41ac2e.zip |
set engine's route in the functional test is generated in the engine
Diffstat (limited to 'railties/lib/rails/generators')
-rw-r--r-- | railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb | 6 | ||||
-rw-r--r-- | railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb | 3 |
2 files changed, 9 insertions, 0 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 509bd60564..7106096b60 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 @@ -2,6 +2,12 @@ require 'test_helper' <% module_namespacing do -%> class <%= class_name %>ControllerTest < ActionController::TestCase +<% if defined?(ENGINE_ROOT) -%> + setup do + @routes = Engine.routes + end + +<% end -%> <% if actions.empty? -%> # test "the truth" do # assert true diff --git a/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb b/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb index 76313575e9..d2799994f1 100644 --- a/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb +++ b/railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb @@ -4,6 +4,9 @@ require 'test_helper' class <%= controller_class_name %>ControllerTest < ActionController::TestCase setup do @<%= singular_table_name %> = <%= table_name %>(:one) +<% if defined?(ENGINE_ROOT) -%> + @routes = Engine.routes +<% end -%> end test "should get index" do |