summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-06-11 00:18:09 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-06-11 00:18:09 +0000
commit96f5d315ea029e2f49df462cd20320869bf10ee3 (patch)
treeaa2ea51ecd5823ca5eb033d7d971b9bb79dfd79f /test
parent9b63117856ca58a7eb117c345ab81aeea2bb1299 (diff)
downloadredmine-96f5d315ea029e2f49df462cd20320869bf10ee3.tar.gz
redmine-96f5d315ea029e2f49df462cd20320869bf10ee3.zip
add some avatar tests
* the default size was 50px * class="gravatar"' * some tests to test the default and option parsing Contributed Felix Schäfer. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9811 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/helpers/application_helper_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb
index a99bddc57..8b22df08a 100644
--- a/test/unit/helpers/application_helper_test.rb
+++ b/test/unit/helpers/application_helper_test.rb
@@ -973,6 +973,14 @@ RAW
Setting.gravatar_enabled = '1'
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'))
+ # Default size is 50
+ assert avatar('jsmith <jsmith@somenet.foo>').include?('size=50')
+ assert avatar('jsmith <jsmith@somenet.foo>', :size => 24).include?('size=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)