diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2018-04-07 08:15:17 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2018-04-07 08:15:17 +0000 |
commit | db5d241870701c4a096b6fa32fea651ecf840cc6 (patch) | |
tree | 01482d5920481442965667f1adb3c6a1b91fdb1f | |
parent | fc401c3ab6395c5fd77e0cec0d58ae1669ea6499 (diff) | |
download | redmine-db5d241870701c4a096b6fa32fea651ecf840cc6.tar.gz redmine-db5d241870701c4a096b6fa32fea651ecf840cc6.zip |
Merged test from r17263 into 3.4-stable (#28208).
git-svn-id: http://svn.redmine.org/redmine/branches/3.4-stable@17275 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | test/unit/helpers/application_helper_test.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 8df4f60fc..5065f5c59 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -1328,7 +1328,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')) @@ -1340,10 +1339,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 |