diff options
author | Yves Senn <yves.senn@gmail.com> | 2016-02-15 15:25:52 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2016-02-15 15:25:52 +0100 |
commit | cfd61919dadc8eb1f4945beca366b4b947a4f8d1 (patch) | |
tree | 124db9c4e39d4ee1c9fea8e349678848234ddf70 /railties/test | |
parent | 07e422f58d61da0da4fce3180c3b79982e208143 (diff) | |
parent | 0146a055c001d0e48eaa5c5df8ccc8a5d15f6708 (diff) | |
download | rails-cfd61919dadc8eb1f4945beca366b4b947a4f8d1.tar.gz rails-cfd61919dadc8eb1f4945beca366b4b947a4f8d1.tar.bz2 rails-cfd61919dadc8eb1f4945beca366b4b947a4f8d1.zip |
Merge pull request #23631 from y-yagi/generate_mailer_views_in_api
generate mailer views in Rails API
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 |