diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-01-03 21:45:25 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-03 21:45:25 -0500 |
commit | 1e969bfb98b88799e2c759fce25a1d8cf00d7ce7 (patch) | |
tree | 289fe880144145088e3839074b691ba35b78a1b5 /railties/test | |
parent | a5041f267ded119c2d00b8786c2f2c1e3f93c8a1 (diff) | |
parent | 085546df456139b6c5d2cde964133e93a0818571 (diff) | |
download | rails-1e969bfb98b88799e2c759fce25a1d8cf00d7ce7.tar.gz rails-1e969bfb98b88799e2c759fce25a1d8cf00d7ce7.tar.bz2 rails-1e969bfb98b88799e2c759fce25a1d8cf00d7ce7.zip |
Merge pull request #27550 from mtsmfm/fix-generator-command-for-nested-rails-engine
Fix generator command for nested (namespaced) rails engine
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/generators/scaffold_generator_test.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/railties/test/generators/scaffold_generator_test.rb b/railties/test/generators/scaffold_generator_test.rb index 6b7e2c91d7..e2b2acab0f 100644 --- a/railties/test/generators/scaffold_generator_test.rb +++ b/railties/test/generators/scaffold_generator_test.rb @@ -492,6 +492,26 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase end end + def test_scaffold_tests_pass_by_default_inside_namespaced_mountable_engine + Dir.chdir(destination_root) { `bundle exec rails plugin new bukkits-admin --mountable` } + + engine_path = File.join(destination_root, "bukkits-admin") + + Dir.chdir(engine_path) do + quietly do + `bin/rails g scaffold User name:string age:integer; + bin/rails db:migrate` + end + + assert_file "bukkits-admin/app/controllers/bukkits/admin/users_controller.rb" do |content| + assert_match(/module Bukkits::Admin/, content) + assert_match(/class UsersController < ApplicationController/, content) + end + + assert_match(/8 runs, 10 assertions, 0 failures, 0 errors/, `bin/rails test 2>&1`) + end + end + def test_scaffold_tests_pass_by_default_inside_full_engine Dir.chdir(destination_root) { `bundle exec rails plugin new bukkits --full` } |