diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2018-04-07 07:49:43 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2018-04-07 07:49:43 +0000 |
commit | 0e362e84abc8e0529e7ea02db33fbb25093e0868 (patch) | |
tree | 9cb4c53ff7fb3b0a90a7ae5ae9021f1dd2e0a2d7 /test | |
parent | 040f31d867c3764abda4e0d0b08b96565ba088f9 (diff) | |
download | redmine-0e362e84abc8e0529e7ea02db33fbb25093e0868.tar.gz redmine-0e362e84abc8e0529e7ea02db33fbb25093e0868.zip |
Security notification on password recovery is empty (#28302).
Patch by Felix Schäfer.
git-svn-id: http://svn.redmine.org/redmine/trunk@17269 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/mailer_test.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/unit/mailer_test.rb b/test/unit/mailer_test.rb index 87fcf84e7..36f028d89 100644 --- a/test/unit/mailer_test.rb +++ b/test/unit/mailer_test.rb @@ -721,6 +721,23 @@ class MailerTest < ActiveSupport::TestCase end end + def test_security_notification_with_overridden_originator_and_remote_ip + set_language_if_valid User.find(1).language + with_settings :emails_footer => "footer without link" do + User.current.remote_ip = '192.168.1.1' + assert Mailer.security_notification(User.find(1), message: :notice_account_password_updated, originator: User.find(2), remote_ip: '10.0.0.42').deliver + mail = last_email + assert_not_nil mail + assert_mail_body_match User.find(2).login, mail + assert_mail_body_match '10.0.0.42', mail + assert_mail_body_match I18n.t(:notice_account_password_updated), mail + assert_select_email do + assert_select "h1", false + assert_select "a", false + end + end + end + def test_security_notification_should_include_title set_language_if_valid User.find(2).language with_settings :emails_footer => "footer without link" do |