summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2018-01-07 22:06:11 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2018-01-07 22:06:11 +0000
commit8f93f08e1c4a22d5ea8fe47271cd9d46b4112a8f (patch)
tree17df4d79cc74a93903b3ff5061dc08aff384b392 /test
parent8072c0dd1e75e8df65548b8a98b1a471ea206b88 (diff)
downloadredmine-8f93f08e1c4a22d5ea8fe47271cd9d46b4112a8f.tar.gz
redmine-8f93f08e1c4a22d5ea8fe47271cd9d46b4112a8f.zip
Merged r17150 to 3.3-stable (#26699).
git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@17152 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/helpers/application_helper_test.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb
index c82922cd0..2285944af 100644
--- a/test/unit/helpers/application_helper_test.rb
+++ b/test/unit/helpers/application_helper_test.rb
@@ -1291,6 +1291,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 <jsmith@somenet.foo>').include?(Digest::MD5.hexdigest('jsmith@somenet.foo'))
@@ -1302,8 +1303,10 @@ RAW
# The default class of the img tag should be gravatar
assert avatar('jsmith <jsmith@somenet.foo>').include?('class="gravatar"')
assert !avatar('jsmith <jsmith@somenet.foo>', :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