DEV: Commit failing test for email substution bug

This commit is contained in:
Kane York 2021-07-05 12:27:31 -07:00 committed by Kane York
parent c39ab6c0ae
commit 371fba6ae0

View File

@ -149,6 +149,30 @@ describe Jobs::UserEmail do
) )
end 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 it "sends an email by default for a PM to a user that's been recently seen" do
upload = Fabricate(:upload) upload = Fabricate(:upload)