diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 80a8a50d..2ecf9671 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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 diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 00985c3c..b964b85d 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -669,6 +669,9 @@ RAW assert avatar('jsmith ', :size => 24).include?('s=24') # Non-avatar options should be considered html options assert avatar('jsmith ', :title => 'John Smith').include?('title="John Smith"') + # 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)