]> git.openstreetmap.org Git - rails.git/commitdiff
Fix missing html layout for user_mailer emails
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 11 Nov 2020 11:19:20 +0000 (11:19 +0000)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 11 Nov 2020 11:19:20 +0000 (11:19 +0000)
This was caused by renaming the mailer without renaming the layout. Added a test to cover this in future.

Fixes #2903

app/views/layouts/user_mailer.html.erb [moved from app/views/layouts/notifier.html.erb with 100% similarity]
test/mailers/user_mailer_test.rb [new file with mode: 0644]

diff --git a/test/mailers/user_mailer_test.rb b/test/mailers/user_mailer_test.rb
new file mode 100644 (file)
index 0000000..2313695
--- /dev/null
@@ -0,0 +1,9 @@
+require "test_helper"
+
+class UserMailerTest < ActionMailer::TestCase
+  def test_html_layout_is_used
+    email = UserMailer.message_notification(create(:message))
+
+    assert_match(/<html lang=/, email.html_part.body.to_s)
+  end
+end