diff options
author | Prathamesh Sonpatki <csonpatki@gmail.com> | 2016-03-12 09:01:06 +0530 |
---|---|---|
committer | Prathamesh Sonpatki <csonpatki@gmail.com> | 2016-03-12 09:40:54 +0530 |
commit | 4d0bf49b92a77542185644660f2c9cec98e66de5 (patch) | |
tree | 07f675ca68ad9a3d5ad379e721c7006ae9acf955 /railties/test | |
parent | 9201030320d09bb2ec76a7cc59aa58f77f984995 (diff) | |
download | rails-4d0bf49b92a77542185644660f2c9cec98e66de5.tar.gz rails-4d0bf49b92a77542185644660f2c9cec98e66de5.tar.bz2 rails-4d0bf49b92a77542185644660f2c9cec98e66de5.zip |
Correctly generate application_mailer.rb in mountable engines
- Followup of https://github.com/rails/rails/pull/24161.
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/generators/plugin_generator_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
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' } } |