-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
16 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,21 @@ class NewsletterMailboxTest < ActionMailbox::TestCase | |
assert_equal 'Hello world!', Entry.last.title | ||
end | ||
|
||
test 'should find newsletter if plus was written as `%2B`' do | ||
assert_difference 'Entry.count' do | ||
receive_inbound_email_from_mail do |mail| | ||
mail.to '[email protected]' | ||
mail.cc = "newsletter-#{@newsletter.id}%2B#{@newsletter.public_id}@example.com" | ||
mail.from '"me" <[email protected]>' | ||
mail.subject 'Hello world!' | ||
mail.body 'Hello?' | ||
end | ||
end | ||
|
||
assert_equal 'me <[email protected]>', Entry.last.author | ||
assert_equal 'Hello world!', Entry.last.title | ||
end | ||
|
||
test 'should bounce email when public id is mismatched' do | ||
assert_no_difference 'Entry.count' do | ||
receive_inbound_email_from_mail do |mail| | ||
|