From 0e362e84abc8e0529e7ea02db33fbb25093e0868 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 7 Apr 2018 07:49:43 +0000 Subject: Security notification on password recovery is empty (#28302). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by Felix Schäfer. git-svn-id: http://svn.redmine.org/redmine/trunk@17269 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/mailer_test.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test') 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 -- cgit v1.2.3