DEV: Commit failing test for email substution bug

DEV: Commit failing test for email substution bug

diff --git a/spec/jobs/user_email_spec.rb b/spec/jobs/user_email_spec.rb
index c91ed8e..7c46567 100644
--- a/spec/jobs/user_email_spec.rb
+++ b/spec/jobs/user_email_spec.rb
@@ -149,6 +149,30 @@ describe Jobs::UserEmail do
       )
     end
 
+    it "sends an email with no gsub substitution bugs" do
+      upload = Fabricate(:upload)
+
+      post.update!(raw: <<~RAW)
+      This is a test post
+
+      With a \\0 \\1 \\2 in it
+      RAW
+      Jobs::UserEmail.new.execute(
+        type: :user_private_message,
+        user_id: user.id,
+        post_id: post.id,
+        notification_id: notification.id
+      )
+
+      email = ActionMailer::Base.deliveries.first
+
+      expect(email.to).to contain_exactly(user.email)
+
+      html_part = email.parts.find { |x| x.content_type.include? "html" }
+      expect(html_part.body.to_s).to_not include('%{email_content}')
+      expect(html_part.body.to_s).to include('\0')
+    end
+
     it "sends an email by default for a PM to a user that's been recently seen" do
       upload = Fabricate(:upload)
 

GitHub sha: 371fba6ae02b1c86d6487228838b509b156e052f

This commit appears in #13641 which was approved by CvX. It was merged by riking.