summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/messages.yml2
-rw-r--r--test/unit/mailer_test.rb40
2 files changed, 40 insertions, 2 deletions
diff --git a/test/fixtures/messages.yml b/test/fixtures/messages.yml
index e578853d4..8ed376eb2 100644
--- a/test/fixtures/messages.yml
+++ b/test/fixtures/messages.yml
@@ -30,7 +30,7 @@ messages_003:
replies_count: 0
last_reply_id:
content: "An other reply"
- author_id:
+ author_id: 2
parent_id: 1
board_id: 1
messages_004:
diff --git a/test/unit/mailer_test.rb b/test/unit/mailer_test.rb
index aded23cc3..1e09eaa5c 100644
--- a/test/unit/mailer_test.rb
+++ b/test/unit/mailer_test.rb
@@ -95,7 +95,45 @@ class MailerTest < Test::Unit::TestCase
assert !mail.body.include?('<a href="https://mydomain.foo/issues/show/1">Bug #1: Can\'t print recipes</a>')
end
-
+ def test_issue_add_message_id
+ ActionMailer::Base.deliveries.clear
+ issue = Issue.find(1)
+ Mailer.deliver_issue_add(issue)
+ mail = ActionMailer::Base.deliveries.last
+ assert_not_nil mail
+ assert_equal Mailer.message_id_for(issue), mail.message_id
+ assert_nil mail.references
+ end
+
+ def test_issue_edit_message_id
+ ActionMailer::Base.deliveries.clear
+ journal = Journal.find(1)
+ Mailer.deliver_issue_edit(journal)
+ mail = ActionMailer::Base.deliveries.last
+ assert_not_nil mail
+ assert_equal Mailer.message_id_for(journal), mail.message_id
+ assert_equal Mailer.message_id_for(journal.issue), mail.references.to_s
+ end
+
+ def test_message_posted_message_id
+ ActionMailer::Base.deliveries.clear
+ message = Message.find(1)
+ Mailer.deliver_message_posted(message, message.author.mail)
+ mail = ActionMailer::Base.deliveries.last
+ assert_not_nil mail
+ assert_equal Mailer.message_id_for(message), mail.message_id
+ assert_nil mail.references
+ end
+
+ def test_reply_posted_message_id
+ ActionMailer::Base.deliveries.clear
+ message = Message.find(3)
+ Mailer.deliver_message_posted(message, message.author.mail)
+ mail = ActionMailer::Base.deliveries.last
+ assert_not_nil mail
+ assert_equal Mailer.message_id_for(message), mail.message_id
+ assert_equal Mailer.message_id_for(message.parent), mail.references.to_s
+ end
# test mailer methods for each language
def test_issue_add