mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 01:16:22 +08:00
DEV: Commit failing test for email substution bug
This commit is contained in:
parent
c39ab6c0ae
commit
371fba6ae0
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user