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 --- railties/test/generators/plugin_generator_test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'railties/test/generators') 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 -- cgit v1.2.3