diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2016-02-12 21:13:40 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2016-02-15 22:13:32 +0900 |
commit | 0146a055c001d0e48eaa5c5df8ccc8a5d15f6708 (patch) | |
tree | 250f86268858d797fe280a4d6f1d7e4849fb91b3 /railties/test | |
parent | 737b718ea0c88d3f6c139343f957f386e06fffc9 (diff) | |
download | rails-0146a055c001d0e48eaa5c5df8ccc8a5d15f6708.tar.gz rails-0146a055c001d0e48eaa5c5df8ccc8a5d15f6708.tar.bz2 rails-0146a055c001d0e48eaa5c5df8ccc8a5d15f6708.zip |
generate mailer views in Rails API
View files is necessary to send mail, it should be generated even Rails API.
Fixes #23617
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/generators_test.rb | 10 | ||||
-rw-r--r-- | railties/test/generators/api_app_generator_test.rb | 4 |
2 files changed, 13 insertions, 1 deletions
diff --git a/railties/test/application/generators_test.rb b/railties/test/application/generators_test.rb index 84cc6e120b..644af0e737 100644 --- a/railties/test/application/generators_test.rb +++ b/railties/test/application/generators_test.rb @@ -160,5 +160,15 @@ module ApplicationTests assert Rails::Generators.options[:rails][:helper] assert_equal :my_template, Rails::Generators.options[:rails][:template_engine] end + + test "api only generator generate mailer views" do + add_to_config <<-RUBY + config.api_only = true + RUBY + + FileUtils.cd(rails_root){ `bin/rails generate mailer notifier foo` } + assert File.exist?(File.join(rails_root, "app/views/notifier_mailer/foo.text.erb")) + assert File.exist?(File.join(rails_root, "app/views/notifier_mailer/foo.html.erb")) + end end end diff --git a/railties/test/generators/api_app_generator_test.rb b/railties/test/generators/api_app_generator_test.rb index 1ea5661006..8e1cd0891a 100644 --- a/railties/test/generators/api_app_generator_test.rb +++ b/railties/test/generators/api_app_generator_test.rb @@ -73,6 +73,8 @@ class ApiAppGeneratorTest < Rails::Generators::TestCase app/controllers app/mailers app/models + app/views/layouts/mailer.html.erb + app/views/layouts/mailer.text.erb config/environments config/initializers config/locales @@ -94,7 +96,7 @@ class ApiAppGeneratorTest < Rails::Generators::TestCase def skipped_files %w(app/assets app/helpers - app/views + app/views/layouts/application.html.erb config/initializers/assets.rb config/initializers/cookies_serializer.rb config/initializers/session_store.rb |