]> source.dussan.org Git - redmine.git/commitdiff
Merged test from r17263 into 3.3-stable (#28208).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 7 Apr 2018 08:16:48 +0000 (08:16 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 7 Apr 2018 08:16:48 +0000 (08:16 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@17276 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/helpers/application_helper_test.rb

index ff8e4e28eae60f196b212f2a64d32f2fb26729e8..616bc2dc7c2ced3c31c1a36f2c3388100c67411c 100644 (file)
@@ -1291,7 +1291,6 @@ 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'))
@@ -1303,10 +1302,12 @@ 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_match tag_for_anonymous_re, avatar('jsmith')
-      assert_match tag_for_anonymous_re, avatar(nil)
+      assert_nil avatar('jsmith')
+      assert_nil avatar(nil)
       # Avatar for anonymous user
-      assert_match tag_for_anonymous_re, avatar(User.anonymous)
+      assert_match %r{src="/images/anonymous.png(\?\d+)?"}, avatar(User.anonymous)
+      # No avatar for groups
+      assert_nil avatar(Group.first)
       assert avatar(User.anonymous, :size => 24).include?('width="24" height="24"')
     end
   end