diff options
Diffstat (limited to 'railties/test/generators')
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 14 | ||||
-rw-r--r-- | railties/test/generators/mailer_generator_test.rb | 2 | ||||
-rw-r--r-- | railties/test/generators/plugin_generator_test.rb | 13 |
3 files changed, 28 insertions, 1 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index f38e773ea8..0572a23df9 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -215,6 +215,20 @@ class AppGeneratorTest < Rails::Generators::TestCase end end + def test_rails_update_dont_set_file_watcher + app_root = File.join(destination_root, 'myapp') + run_generator [app_root] + + stub_rails_application(app_root) do + generator = Rails::Generators::AppGenerator.new ["rails"], [], destination_root: app_root, shell: @shell + generator.send(:app_const) + quietly { generator.send(:update_config_files) } + assert_file "#{app_root}/config/environments/development.rb" do |content| + assert_match(/# config.file_watcher/, content) + end + end + end + def test_rails_update_does_not_create_active_record_belongs_to_required_by_default app_root = File.join(destination_root, 'myapp') run_generator [app_root] diff --git a/railties/test/generators/mailer_generator_test.rb b/railties/test/generators/mailer_generator_test.rb index 71c11e5ef6..8728b39dae 100644 --- a/railties/test/generators/mailer_generator_test.rb +++ b/railties/test/generators/mailer_generator_test.rb @@ -16,7 +16,7 @@ class MailerGeneratorTest < Rails::Generators::TestCase assert_file 'app/mailers/application_mailer.rb' do |mailer| assert_match(/class ApplicationMailer < ActionMailer::Base/, mailer) assert_match(/default from: 'from@example.com'/, mailer) - assert_match(/layout :mailer/, mailer) + assert_match(/layout 'mailer'/, mailer) end end diff --git a/railties/test/generators/plugin_generator_test.rb b/railties/test/generators/plugin_generator_test.rb index cf3ed8405d..17a2c6a327 100644 --- a/railties/test/generators/plugin_generator_test.rb +++ b/railties/test/generators/plugin_generator_test.rb @@ -656,6 +656,19 @@ class PluginGeneratorTest < Rails::Generators::TestCase end end + def test_generate_application_mailer_when_does_not_exist_in_mountable_engine + run_generator [destination_root, '--mountable'] + FileUtils.rm "#{destination_root}/app/mailers/bukkits/application_mailer.rb" + capture(:stdout) do + `#{destination_root}/bin/rails g mailer User` + end + + assert_file "#{destination_root}/app/mailers/bukkits/application_mailer.rb" do |mailer| + assert_match(/module Bukkits/, mailer) + assert_match(/class ApplicationMailer < ActionMailer::Base/, mailer) + end + end + def test_after_bundle_callback path = 'http://example.org/rails_template' template = %{ after_bundle { run 'echo ran after_bundle' } } |