summaryrefslogtreecommitdiff
path: root/test/unit/helpers/application_helper_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/helpers/application_helper_test.rb')
-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 3bb018be1..941ba7ef0 100644
--- a/test/unit/helpers/application_helper_test.rb
+++ b/test/unit/helpers/application_helper_test.rb
@@ -1328,6 +1328,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'))
@@ -1339,8 +1340,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