aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-08-09 23:50:27 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-08-09 23:50:27 -0300
commit6e6cfb665af0ffc1283efa40f14615e1f3917c16 (patch)
treeebdf8a9cfe14871b326746ad551be7575b110c6b /railties/lib/rails
parent8d0c107a60a5f240c7a6e9caee4ad10cff8fe63e (diff)
parent22d863d272eea25eaa391c07532e4f1279c46721 (diff)
downloadrails-6e6cfb665af0ffc1283efa40f14615e1f3917c16.tar.gz
rails-6e6cfb665af0ffc1283efa40f14615e1f3917c16.tar.bz2
rails-6e6cfb665af0ffc1283efa40f14615e1f3917c16.zip
Merge pull request #21176 from y-yagi/fix_scaffold_tests_inside_api_engine
make generated scaffold functional tests work inside API engines
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/generators/test_unit/scaffold/templates/api_functional_test.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/test_unit/scaffold/templates/api_functional_test.rb b/railties/lib/rails/generators/test_unit/scaffold/templates/api_functional_test.rb
index 896b38bc8f..f302cd6c3d 100644
--- a/railties/lib/rails/generators/test_unit/scaffold/templates/api_functional_test.rb
+++ b/railties/lib/rails/generators/test_unit/scaffold/templates/api_functional_test.rb
@@ -3,7 +3,10 @@ require 'test_helper'
<% module_namespacing do -%>
class <%= controller_class_name %>ControllerTest < ActionController::TestCase
setup do
- @<%= singular_table_name %> = <%= table_name %>(:one)
+ @<%= singular_table_name %> = <%= fixture_name %>(:one)
+<% if mountable_engine? -%>
+ @routes = Engine.routes
+<% end -%>
end
test "should get index" do