diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/generators/erb/mailer/mailer_generator.rb | 8 | ||||
-rw-r--r-- | railties/test/generators/mailer_generator_test.rb | 4 | ||||
-rw-r--r-- | railties/test/generators/namespaced_generators_test.rb | 2 |
3 files changed, 10 insertions, 4 deletions
diff --git a/railties/lib/rails/generators/erb/mailer/mailer_generator.rb b/railties/lib/rails/generators/erb/mailer/mailer_generator.rb index 1e290bb938..a228484c11 100644 --- a/railties/lib/rails/generators/erb/mailer/mailer_generator.rb +++ b/railties/lib/rails/generators/erb/mailer/mailer_generator.rb @@ -13,11 +13,11 @@ module Erb # :nodoc: @action = action formats.each do |format| - @view_path = File.join(view_base_path, filename_with_extensions(action, format)) - template filename_with_extensions(:view, format), @view_path + @path = File.join(view_base_path, filename_with_extensions(action, format)) + template filename_with_extensions(:view, format), @path - @layout_path = File.join(layout_base_path, filename_with_extensions("mailer", format)) - template filename_with_extensions(:layout, format), @layout_path + layout_path = File.join(layout_base_path, filename_with_extensions("mailer", format)) + template filename_with_extensions(:layout, format), layout_path end end diff --git a/railties/test/generators/mailer_generator_test.rb b/railties/test/generators/mailer_generator_test.rb index 915dde1109..20fffd25de 100644 --- a/railties/test/generators/mailer_generator_test.rb +++ b/railties/test/generators/mailer_generator_test.rb @@ -79,10 +79,12 @@ class MailerGeneratorTest < Rails::Generators::TestCase def test_invokes_default_text_template_engine run_generator assert_file "app/views/notifier/foo.text.erb" do |view| + assert_match(%r(\sapp/views/notifier/foo\.text\.erb), view) assert_match(/<%= @greeting %>/, view) end assert_file "app/views/notifier/bar.text.erb" do |view| + assert_match(%r(\sapp/views/notifier/bar\.text\.erb), view) assert_match(/<%= @greeting %>/, view) end @@ -94,10 +96,12 @@ class MailerGeneratorTest < Rails::Generators::TestCase def test_invokes_default_html_template_engine run_generator assert_file "app/views/notifier/foo.html.erb" do |view| + assert_match(%r(\sapp/views/notifier/foo\.html\.erb), view) assert_match(/<%= @greeting %>/, view) end assert_file "app/views/notifier/bar.html.erb" do |view| + assert_match(%r(\sapp/views/notifier/bar\.html\.erb), view) assert_match(/<%= @greeting %>/, view) end diff --git a/railties/test/generators/namespaced_generators_test.rb b/railties/test/generators/namespaced_generators_test.rb index 20e8d2d5d3..6075805152 100644 --- a/railties/test/generators/namespaced_generators_test.rb +++ b/railties/test/generators/namespaced_generators_test.rb @@ -174,10 +174,12 @@ class NamespacedMailerGeneratorTest < NamespacedGeneratorTestCase def test_invokes_default_template_engine run_generator assert_file "app/views/test_app/notifier/foo.text.erb" do |view| + assert_match(%r(app/views/test_app/notifier/foo\.text\.erb), view) assert_match(/<%= @greeting %>/, view) end assert_file "app/views/test_app/notifier/bar.text.erb" do |view| + assert_match(%r(app/views/test_app/notifier/bar\.text\.erb), view) assert_match(/<%= @greeting %>/, view) end end |