Restore the default class for gravatars #1034

This commit is contained in:
Felix Schäfer 2012-06-10 20:34:23 +02:00
parent 5ef63ec4bb
commit caceb58947
2 changed files with 4 additions and 0 deletions

View File

@ -962,6 +962,7 @@ module ApplicationHelper
[:default, :size, :rating, :filetype].each {|key| gravatarify_options[key] = options.delete key}
# Default size is 50x50 px
gravatarify_options[:size] ||= 50
options[:class] ||= 'gravatar'
gravatarify_options[:html] = options
gravatar_tag email, gravatarify_options
end

View File

@ -669,6 +669,9 @@ RAW
assert avatar('jsmith <jsmith@somenet.foo>', :size => 24).include?('s=24')
# Non-avatar options should be considered html options
assert avatar('jsmith <jsmith@somenet.foo>', :title => 'John Smith').include?('title="John Smith"')
# 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)