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/test/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/test/generators')
-rw-r--r-- | railties/test/generators/plugin_generator_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/railties/test/generators/plugin_generator_test.rb b/railties/test/generators/plugin_generator_test.rb index d6e5f4bd89..0716783d42 100644 --- a/railties/test/generators/plugin_generator_test.rb +++ b/railties/test/generators/plugin_generator_test.rb @@ -508,6 +508,21 @@ class PluginGeneratorTest < Rails::Generators::TestCase assert_match(/namespace :admin/, contents) assert_no_match(/namespace :bukkit/, contents) end + assert_file "test/controllers/bukkits/admin/dashboard_controller_test.rb" do |contents| + assert_match(/@routes = Engine.routes/, contents) + end + end + + def test_generating_scaffold_controller_inside_mountable_engine + run_generator [destination_root, "--mountable"] + + capture(:stdout) do + `#{destination_root}/bin/rails g scaffold User name:string age:integer` + end + + assert_file "test/controllers/bukkits/users_controller_test.rb" do |contents| + assert_match(/@routes = Engine.routes/, contents) + end end def test_git_name_and_email_in_gemspec_file |