From 6a8d91897bae19f5d30f51a2731d9bbf7f41ac2e Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Tue, 5 May 2015 22:40:16 +0900 Subject: set engine's route in the functional test is generated in the engine --- .../generators/test_unit/controller/templates/functional_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb') 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 -- cgit v1.2.3