|
|
@ -36,60 +36,80 @@ class MailerTest < ActiveSupport::TestCase
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def test_generated_links_in_emails
|
|
|
|
def test_generated_links_in_emails
|
|
|
|
|
|
|
|
Setting.default_language = 'en'
|
|
|
|
Setting.host_name = 'mydomain.foo'
|
|
|
|
Setting.host_name = 'mydomain.foo'
|
|
|
|
Setting.protocol = 'https'
|
|
|
|
Setting.protocol = 'https'
|
|
|
|
|
|
|
|
|
|
|
|
journal = Journal.find(2)
|
|
|
|
journal = Journal.find(3)
|
|
|
|
assert Mailer.deliver_issue_edit(journal)
|
|
|
|
assert Mailer.deliver_issue_edit(journal)
|
|
|
|
|
|
|
|
|
|
|
|
mail = ActionMailer::Base.deliveries.last
|
|
|
|
mail = last_email
|
|
|
|
assert_not_nil mail
|
|
|
|
assert_not_nil mail
|
|
|
|
|
|
|
|
|
|
|
|
assert_select_email do
|
|
|
|
assert_select_email do
|
|
|
|
# link to the main ticket
|
|
|
|
# link to the main ticket
|
|
|
|
assert_select "a[href=?]",
|
|
|
|
assert_select 'a[href=?]',
|
|
|
|
"https://mydomain.foo/issues/1#change-2",
|
|
|
|
'https://mydomain.foo/issues/2#change-3',
|
|
|
|
:text => "Bug #1: Can't print recipes"
|
|
|
|
:text => 'Feature request #2: Add ingredients categories'
|
|
|
|
# link to a referenced ticket
|
|
|
|
# link to a referenced ticket
|
|
|
|
assert_select "a[href=?][title=?]",
|
|
|
|
assert_select 'a[href=?][title=?]',
|
|
|
|
"https://mydomain.foo/issues/2",
|
|
|
|
'https://mydomain.foo/issues/1',
|
|
|
|
"Add ingredients categories (Assigned)",
|
|
|
|
'Can\'t print recipes (New)',
|
|
|
|
:text => "#2"
|
|
|
|
:text => '#1'
|
|
|
|
# link to a changeset
|
|
|
|
# link to a changeset
|
|
|
|
assert_select "a[href=?][title=?]",
|
|
|
|
assert_select 'a[href=?][title=?]',
|
|
|
|
"https://mydomain.foo/projects/ecookbook/repository/revisions/2",
|
|
|
|
'https://mydomain.foo/projects/ecookbook/repository/revisions/2',
|
|
|
|
"This commit fixes #1, #2 and references #1 & #3",
|
|
|
|
'This commit fixes #1, #2 and references #1 & #3',
|
|
|
|
:text => "r2"
|
|
|
|
:text => 'r2'
|
|
|
|
|
|
|
|
# link to a description diff
|
|
|
|
|
|
|
|
assert_select 'a[href=?][title=?]',
|
|
|
|
|
|
|
|
'https://mydomain.foo/journals/diff/3?detail_id=4',
|
|
|
|
|
|
|
|
'View differences',
|
|
|
|
|
|
|
|
:text => 'diff'
|
|
|
|
|
|
|
|
# link to an attachment
|
|
|
|
|
|
|
|
assert_select 'a[href=?]',
|
|
|
|
|
|
|
|
'https://mydomain.foo/attachments/download/4/source.rb',
|
|
|
|
|
|
|
|
:text => 'source.rb'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def test_generated_links_with_prefix
|
|
|
|
def test_generated_links_with_prefix
|
|
|
|
|
|
|
|
Setting.default_language = 'en'
|
|
|
|
relative_url_root = Redmine::Utils.relative_url_root
|
|
|
|
relative_url_root = Redmine::Utils.relative_url_root
|
|
|
|
Setting.host_name = 'mydomain.foo/rdm'
|
|
|
|
Setting.host_name = 'mydomain.foo/rdm'
|
|
|
|
Setting.protocol = 'http'
|
|
|
|
Setting.protocol = 'http'
|
|
|
|
Redmine::Utils.relative_url_root = '/rdm'
|
|
|
|
Redmine::Utils.relative_url_root = '/rdm'
|
|
|
|
|
|
|
|
|
|
|
|
journal = Journal.find(2)
|
|
|
|
journal = Journal.find(3)
|
|
|
|
assert Mailer.deliver_issue_edit(journal)
|
|
|
|
assert Mailer.deliver_issue_edit(journal)
|
|
|
|
|
|
|
|
|
|
|
|
mail = ActionMailer::Base.deliveries.last
|
|
|
|
mail = last_email
|
|
|
|
assert_not_nil mail
|
|
|
|
assert_not_nil mail
|
|
|
|
|
|
|
|
|
|
|
|
assert_select_email do
|
|
|
|
assert_select_email do
|
|
|
|
# link to the main ticket
|
|
|
|
# link to the main ticket
|
|
|
|
assert_select "a[href=?]",
|
|
|
|
assert_select 'a[href=?]',
|
|
|
|
"http://mydomain.foo/rdm/issues/1#change-2",
|
|
|
|
'http://mydomain.foo/rdm/issues/2#change-3',
|
|
|
|
:text => "Bug #1: Can't print recipes"
|
|
|
|
:text => 'Feature request #2: Add ingredients categories'
|
|
|
|
# link to a referenced ticket
|
|
|
|
# link to a referenced ticket
|
|
|
|
assert_select "a[href=?][title=?]",
|
|
|
|
assert_select 'a[href=?][title=?]',
|
|
|
|
"http://mydomain.foo/rdm/issues/2",
|
|
|
|
'http://mydomain.foo/rdm/issues/1',
|
|
|
|
"Add ingredients categories (Assigned)",
|
|
|
|
'Can\'t print recipes (New)',
|
|
|
|
:text => "#2"
|
|
|
|
:text => '#1'
|
|
|
|
# link to a changeset
|
|
|
|
# link to a changeset
|
|
|
|
assert_select "a[href=?][title=?]",
|
|
|
|
assert_select 'a[href=?][title=?]',
|
|
|
|
"http://mydomain.foo/rdm/projects/ecookbook/repository/revisions/2",
|
|
|
|
'http://mydomain.foo/rdm/projects/ecookbook/repository/revisions/2',
|
|
|
|
"This commit fixes #1, #2 and references #1 & #3",
|
|
|
|
'This commit fixes #1, #2 and references #1 & #3',
|
|
|
|
:text => "r2"
|
|
|
|
:text => 'r2'
|
|
|
|
|
|
|
|
# link to a description diff
|
|
|
|
|
|
|
|
assert_select 'a[href=?][title=?]',
|
|
|
|
|
|
|
|
'http://mydomain.foo/rdm/journals/diff/3?detail_id=4',
|
|
|
|
|
|
|
|
'View differences',
|
|
|
|
|
|
|
|
:text => 'diff'
|
|
|
|
|
|
|
|
# link to an attachment
|
|
|
|
|
|
|
|
assert_select 'a[href=?]',
|
|
|
|
|
|
|
|
'http://mydomain.foo/rdm/attachments/download/4/source.rb',
|
|
|
|
|
|
|
|
:text => 'source.rb'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
ensure
|
|
|
|
ensure
|
|
|
|
# restore it
|
|
|
|
# restore it
|
|
|
@ -97,32 +117,42 @@ class MailerTest < ActiveSupport::TestCase
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def test_generated_links_with_prefix_and_no_relative_url_root
|
|
|
|
def test_generated_links_with_prefix_and_no_relative_url_root
|
|
|
|
|
|
|
|
Setting.default_language = 'en'
|
|
|
|
relative_url_root = Redmine::Utils.relative_url_root
|
|
|
|
relative_url_root = Redmine::Utils.relative_url_root
|
|
|
|
Setting.host_name = 'mydomain.foo/rdm'
|
|
|
|
Setting.host_name = 'mydomain.foo/rdm'
|
|
|
|
Setting.protocol = 'http'
|
|
|
|
Setting.protocol = 'http'
|
|
|
|
Redmine::Utils.relative_url_root = nil
|
|
|
|
Redmine::Utils.relative_url_root = nil
|
|
|
|
|
|
|
|
|
|
|
|
journal = Journal.find(2)
|
|
|
|
journal = Journal.find(3)
|
|
|
|
assert Mailer.deliver_issue_edit(journal)
|
|
|
|
assert Mailer.deliver_issue_edit(journal)
|
|
|
|
|
|
|
|
|
|
|
|
mail = ActionMailer::Base.deliveries.last
|
|
|
|
mail = last_email
|
|
|
|
assert_not_nil mail
|
|
|
|
assert_not_nil mail
|
|
|
|
|
|
|
|
|
|
|
|
assert_select_email do
|
|
|
|
assert_select_email do
|
|
|
|
# link to the main ticket
|
|
|
|
# link to the main ticket
|
|
|
|
assert_select "a[href=?]",
|
|
|
|
assert_select 'a[href=?]',
|
|
|
|
"http://mydomain.foo/rdm/issues/1#change-2",
|
|
|
|
'http://mydomain.foo/rdm/issues/2#change-3',
|
|
|
|
:text => "Bug #1: Can't print recipes"
|
|
|
|
:text => 'Feature request #2: Add ingredients categories'
|
|
|
|
# link to a referenced ticket
|
|
|
|
# link to a referenced ticket
|
|
|
|
assert_select "a[href=?][title=?]",
|
|
|
|
assert_select 'a[href=?][title=?]',
|
|
|
|
"http://mydomain.foo/rdm/issues/2",
|
|
|
|
'http://mydomain.foo/rdm/issues/1',
|
|
|
|
"Add ingredients categories (Assigned)",
|
|
|
|
'Can\'t print recipes (New)',
|
|
|
|
:text => "#2"
|
|
|
|
:text => '#1'
|
|
|
|
# link to a changeset
|
|
|
|
# link to a changeset
|
|
|
|
assert_select "a[href=?][title=?]",
|
|
|
|
assert_select 'a[href=?][title=?]',
|
|
|
|
"http://mydomain.foo/rdm/projects/ecookbook/repository/revisions/2",
|
|
|
|
'http://mydomain.foo/rdm/projects/ecookbook/repository/revisions/2',
|
|
|
|
"This commit fixes #1, #2 and references #1 & #3",
|
|
|
|
'This commit fixes #1, #2 and references #1 & #3',
|
|
|
|
:text => "r2"
|
|
|
|
:text => 'r2'
|
|
|
|
|
|
|
|
# link to a description diff
|
|
|
|
|
|
|
|
assert_select 'a[href=?][title=?]',
|
|
|
|
|
|
|
|
'http://mydomain.foo/rdm/journals/diff/3?detail_id=4',
|
|
|
|
|
|
|
|
'View differences',
|
|
|
|
|
|
|
|
:text => 'diff'
|
|
|
|
|
|
|
|
# link to an attachment
|
|
|
|
|
|
|
|
assert_select 'a[href=?]',
|
|
|
|
|
|
|
|
'http://mydomain.foo/rdm/attachments/download/4/source.rb',
|
|
|
|
|
|
|
|
:text => 'source.rb'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
ensure
|
|
|
|
ensure
|
|
|
|
# restore it
|
|
|
|
# restore it
|
|
|
@ -132,7 +162,7 @@ class MailerTest < ActiveSupport::TestCase
|
|
|
|
def test_email_headers
|
|
|
|
def test_email_headers
|
|
|
|
issue = Issue.find(1)
|
|
|
|
issue = Issue.find(1)
|
|
|
|
Mailer.deliver_issue_add(issue)
|
|
|
|
Mailer.deliver_issue_add(issue)
|
|
|
|
mail = ActionMailer::Base.deliveries.last
|
|
|
|
mail = last_email
|
|
|
|
assert_not_nil mail
|
|
|
|
assert_not_nil mail
|
|
|
|
assert_equal 'OOF', mail.header_string('X-Auto-Response-Suppress')
|
|
|
|
assert_equal 'OOF', mail.header_string('X-Auto-Response-Suppress')
|
|
|
|
assert_equal 'auto-generated', mail.header_string('Auto-Submitted')
|
|
|
|
assert_equal 'auto-generated', mail.header_string('Auto-Submitted')
|
|
|
@ -141,8 +171,7 @@ class MailerTest < ActiveSupport::TestCase
|
|
|
|
def test_email_headers_should_include_sender
|
|
|
|
def test_email_headers_should_include_sender
|
|
|
|
issue = Issue.find(1)
|
|
|
|
issue = Issue.find(1)
|
|
|
|
Mailer.deliver_issue_add(issue)
|
|
|
|
Mailer.deliver_issue_add(issue)
|
|
|
|
mail = ActionMailer::Base.deliveries.last
|
|
|
|
mail = last_email
|
|
|
|
assert_not_nil mail
|
|
|
|
|
|
|
|
assert_equal issue.author.login, mail.header_string('X-Redmine-Sender')
|
|
|
|
assert_equal issue.author.login, mail.header_string('X-Redmine-Sender')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -150,7 +179,7 @@ class MailerTest < ActiveSupport::TestCase
|
|
|
|
Setting.plain_text_mail = 1
|
|
|
|
Setting.plain_text_mail = 1
|
|
|
|
journal = Journal.find(2)
|
|
|
|
journal = Journal.find(2)
|
|
|
|
Mailer.deliver_issue_edit(journal)
|
|
|
|
Mailer.deliver_issue_edit(journal)
|
|
|
|
mail = ActionMailer::Base.deliveries.last
|
|
|
|
mail = last_email
|
|
|
|
assert_equal "text/plain", mail.content_type
|
|
|
|
assert_equal "text/plain", mail.content_type
|
|
|
|
assert_equal 0, mail.parts.size
|
|
|
|
assert_equal 0, mail.parts.size
|
|
|
|
assert !mail.encoded.include?('href')
|
|
|
|
assert !mail.encoded.include?('href')
|
|
|
@ -160,7 +189,7 @@ class MailerTest < ActiveSupport::TestCase
|
|
|
|
Setting.plain_text_mail = 0
|
|
|
|
Setting.plain_text_mail = 0
|
|
|
|
journal = Journal.find(2)
|
|
|
|
journal = Journal.find(2)
|
|
|
|
Mailer.deliver_issue_edit(journal)
|
|
|
|
Mailer.deliver_issue_edit(journal)
|
|
|
|
mail = ActionMailer::Base.deliveries.last
|
|
|
|
mail = last_email
|
|
|
|
assert_equal 2, mail.parts.size
|
|
|
|
assert_equal 2, mail.parts.size
|
|
|
|
assert mail.encoded.include?('href')
|
|
|
|
assert mail.encoded.include?('href')
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -169,8 +198,7 @@ class MailerTest < ActiveSupport::TestCase
|
|
|
|
with_settings :mail_from => 'redmine@example.net' do
|
|
|
|
with_settings :mail_from => 'redmine@example.net' do
|
|
|
|
Mailer.deliver_test(User.find(1))
|
|
|
|
Mailer.deliver_test(User.find(1))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
mail = ActionMailer::Base.deliveries.last
|
|
|
|
mail = last_email
|
|
|
|
assert_not_nil mail
|
|
|
|
|
|
|
|
assert_equal 'redmine@example.net', mail.from_addrs.first.address
|
|
|
|
assert_equal 'redmine@example.net', mail.from_addrs.first.address
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -178,8 +206,7 @@ class MailerTest < ActiveSupport::TestCase
|
|
|
|
with_settings :mail_from => 'Redmine app <redmine@example.net>' do
|
|
|
|
with_settings :mail_from => 'Redmine app <redmine@example.net>' do
|
|
|
|
Mailer.deliver_test(User.find(1))
|
|
|
|
Mailer.deliver_test(User.find(1))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
mail = ActionMailer::Base.deliveries.last
|
|
|
|
mail = last_email
|
|
|
|
assert_not_nil mail
|
|
|
|
|
|
|
|
assert_equal 'redmine@example.net', mail.from_addrs.first.address
|
|
|
|
assert_equal 'redmine@example.net', mail.from_addrs.first.address
|
|
|
|
assert_equal 'Redmine app', mail.from_addrs.first.name
|
|
|
|
assert_equal 'Redmine app', mail.from_addrs.first.name
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -208,8 +235,7 @@ class MailerTest < ActiveSupport::TestCase
|
|
|
|
def test_issue_add_message_id
|
|
|
|
def test_issue_add_message_id
|
|
|
|
issue = Issue.find(1)
|
|
|
|
issue = Issue.find(1)
|
|
|
|
Mailer.deliver_issue_add(issue)
|
|
|
|
Mailer.deliver_issue_add(issue)
|
|
|
|
mail = ActionMailer::Base.deliveries.last
|
|
|
|
mail = last_email
|
|
|
|
assert_not_nil mail
|
|
|
|
|
|
|
|
assert_equal Mailer.message_id_for(issue), mail.message_id
|
|
|
|
assert_equal Mailer.message_id_for(issue), mail.message_id
|
|
|
|
assert_nil mail.references
|
|
|
|
assert_nil mail.references
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -217,8 +243,7 @@ class MailerTest < ActiveSupport::TestCase
|
|
|
|
def test_issue_edit_message_id
|
|
|
|
def test_issue_edit_message_id
|
|
|
|
journal = Journal.find(1)
|
|
|
|
journal = Journal.find(1)
|
|
|
|
Mailer.deliver_issue_edit(journal)
|
|
|
|
Mailer.deliver_issue_edit(journal)
|
|
|
|
mail = ActionMailer::Base.deliveries.last
|
|
|
|
mail = last_email
|
|
|
|
assert_not_nil mail
|
|
|
|
|
|
|
|
assert_equal Mailer.message_id_for(journal), mail.message_id
|
|
|
|
assert_equal Mailer.message_id_for(journal), mail.message_id
|
|
|
|
assert_equal Mailer.message_id_for(journal.issue), mail.references.first.to_s
|
|
|
|
assert_equal Mailer.message_id_for(journal.issue), mail.references.first.to_s
|
|
|
|
assert_select_email do
|
|
|
|
assert_select_email do
|
|
|
@ -231,8 +256,7 @@ class MailerTest < ActiveSupport::TestCase
|
|
|
|
def test_message_posted_message_id
|
|
|
|
def test_message_posted_message_id
|
|
|
|
message = Message.find(1)
|
|
|
|
message = Message.find(1)
|
|
|
|
Mailer.deliver_message_posted(message)
|
|
|
|
Mailer.deliver_message_posted(message)
|
|
|
|
mail = ActionMailer::Base.deliveries.last
|
|
|
|
mail = last_email
|
|
|
|
assert_not_nil mail
|
|
|
|
|
|
|
|
assert_equal Mailer.message_id_for(message), mail.message_id
|
|
|
|
assert_equal Mailer.message_id_for(message), mail.message_id
|
|
|
|
assert_nil mail.references
|
|
|
|
assert_nil mail.references
|
|
|
|
assert_select_email do
|
|
|
|
assert_select_email do
|
|
|
@ -246,8 +270,7 @@ class MailerTest < ActiveSupport::TestCase
|
|
|
|
def test_reply_posted_message_id
|
|
|
|
def test_reply_posted_message_id
|
|
|
|
message = Message.find(3)
|
|
|
|
message = Message.find(3)
|
|
|
|
Mailer.deliver_message_posted(message)
|
|
|
|
Mailer.deliver_message_posted(message)
|
|
|
|
mail = ActionMailer::Base.deliveries.last
|
|
|
|
mail = last_email
|
|
|
|
assert_not_nil mail
|
|
|
|
|
|
|
|
assert_equal Mailer.message_id_for(message), mail.message_id
|
|
|
|
assert_equal Mailer.message_id_for(message), mail.message_id
|
|
|
|
assert_equal Mailer.message_id_for(message.parent), mail.references.first.to_s
|
|
|
|
assert_equal Mailer.message_id_for(message.parent), mail.references.first.to_s
|
|
|
|
assert_select_email do
|
|
|
|
assert_select_email do
|
|
|
@ -425,7 +448,7 @@ class MailerTest < ActiveSupport::TestCase
|
|
|
|
token.reload
|
|
|
|
token.reload
|
|
|
|
ActionMailer::Base.deliveries.clear
|
|
|
|
ActionMailer::Base.deliveries.clear
|
|
|
|
assert Mailer.deliver_register(token)
|
|
|
|
assert Mailer.deliver_register(token)
|
|
|
|
mail = ActionMailer::Base.deliveries.last
|
|
|
|
mail = last_email
|
|
|
|
assert_select_email do
|
|
|
|
assert_select_email do
|
|
|
|
assert_select "a[href=?]",
|
|
|
|
assert_select "a[href=?]",
|
|
|
|
"https://redmine.foo/account/activate?token=#{token.value}",
|
|
|
|
"https://redmine.foo/account/activate?token=#{token.value}",
|
|
|
@ -445,7 +468,7 @@ class MailerTest < ActiveSupport::TestCase
|
|
|
|
def test_reminders
|
|
|
|
def test_reminders
|
|
|
|
Mailer.reminders(:days => 42)
|
|
|
|
Mailer.reminders(:days => 42)
|
|
|
|
assert_equal 1, ActionMailer::Base.deliveries.size
|
|
|
|
assert_equal 1, ActionMailer::Base.deliveries.size
|
|
|
|
mail = ActionMailer::Base.deliveries.last
|
|
|
|
mail = last_email
|
|
|
|
assert mail.bcc.include?('dlopper@somenet.foo')
|
|
|
|
assert mail.bcc.include?('dlopper@somenet.foo')
|
|
|
|
assert mail.body.include?('Bug #3: Error 281 when updating a recipe')
|
|
|
|
assert mail.body.include?('Bug #3: Error 281 when updating a recipe')
|
|
|
|
assert_equal '1 issue(s) due in the next 42 days', mail.subject
|
|
|
|
assert_equal '1 issue(s) due in the next 42 days', mail.subject
|
|
|
@ -460,7 +483,7 @@ class MailerTest < ActiveSupport::TestCase
|
|
|
|
|
|
|
|
|
|
|
|
Mailer.reminders(:days => 42)
|
|
|
|
Mailer.reminders(:days => 42)
|
|
|
|
assert_equal 1, ActionMailer::Base.deliveries.size
|
|
|
|
assert_equal 1, ActionMailer::Base.deliveries.size
|
|
|
|
mail = ActionMailer::Base.deliveries.last
|
|
|
|
mail = last_email
|
|
|
|
assert mail.bcc.include?('dlopper@somenet.foo')
|
|
|
|
assert mail.bcc.include?('dlopper@somenet.foo')
|
|
|
|
assert !mail.body.include?('Closed issue')
|
|
|
|
assert !mail.body.include?('Closed issue')
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -471,7 +494,7 @@ class MailerTest < ActiveSupport::TestCase
|
|
|
|
assert_equal 0, ActionMailer::Base.deliveries.size # No mail for dlopper
|
|
|
|
assert_equal 0, ActionMailer::Base.deliveries.size # No mail for dlopper
|
|
|
|
Mailer.reminders(:days => 42, :users => ['3'])
|
|
|
|
Mailer.reminders(:days => 42, :users => ['3'])
|
|
|
|
assert_equal 1, ActionMailer::Base.deliveries.size # No mail for dlopper
|
|
|
|
assert_equal 1, ActionMailer::Base.deliveries.size # No mail for dlopper
|
|
|
|
mail = ActionMailer::Base.deliveries.last
|
|
|
|
mail = last_email
|
|
|
|
assert mail.bcc.include?('dlopper@somenet.foo')
|
|
|
|
assert mail.bcc.include?('dlopper@somenet.foo')
|
|
|
|
assert mail.body.include?('Bug #3: Error 281 when updating a recipe')
|
|
|
|
assert mail.body.include?('Bug #3: Error 281 when updating a recipe')
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -490,7 +513,7 @@ class MailerTest < ActiveSupport::TestCase
|
|
|
|
user = User.find(1)
|
|
|
|
user = User.find(1)
|
|
|
|
user.language = 'fr'
|
|
|
|
user.language = 'fr'
|
|
|
|
Mailer.deliver_account_activated(user)
|
|
|
|
Mailer.deliver_account_activated(user)
|
|
|
|
mail = ActionMailer::Base.deliveries.last
|
|
|
|
mail = last_email
|
|
|
|
assert mail.body.include?('Votre compte')
|
|
|
|
assert mail.body.include?('Votre compte')
|
|
|
|
|
|
|
|
|
|
|
|
assert_equal :it, current_language
|
|
|
|
assert_equal :it, current_language
|
|
|
|