From c7948ed40d9e74b3ee1d9f674913aaad04ab5f85 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 7 Jan 2018 22:01:56 +0000 Subject: Anonymous user should have their icon (#26699). Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@17150 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/helpers/application_helper_test.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'test/helpers') diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb index 6a461c31a..936a0ba84 100644 --- a/test/helpers/application_helper_test.rb +++ b/test/helpers/application_helper_test.rb @@ -1302,6 +1302,7 @@ RAW end def test_avatar_enabled + tag_for_anonymous_re = %r{src="/images/anonymous.png(\?\d+)?"} with_settings :gravatar_enabled => '1' do assert avatar(User.find_by_mail('jsmith@somenet.foo')).include?(Digest::MD5.hexdigest('jsmith@somenet.foo')) assert avatar('jsmith ').include?(Digest::MD5.hexdigest('jsmith@somenet.foo')) @@ -1313,8 +1314,10 @@ RAW # The default class of the img tag should be gravatar assert avatar('jsmith ').include?('class="gravatar"') assert !avatar('jsmith ', :class => 'picture').include?('class="gravatar"') - assert_nil avatar('jsmith') - assert_nil avatar(nil) + assert_match tag_for_anonymous_re, avatar('jsmith') + assert_match tag_for_anonymous_re, avatar(nil) + # Avatar for anonymous user + assert_match tag_for_anonymous_re, avatar(User.anonymous) end end -- cgit v1.2.3