summaryrefslogtreecommitdiffstats
path: root/test/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'test/helpers')
-rw-r--r--test/helpers/application_helper_test.rb14
-rw-r--r--test/helpers/avatars_helper_test.rb10
2 files changed, 5 insertions, 19 deletions
diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb
index 2e2e8b933..1f60bbbe2 100644
--- a/test/helpers/application_helper_test.rb
+++ b/test/helpers/application_helper_test.rb
@@ -2053,20 +2053,6 @@ class ApplicationHelperTest < Redmine::HelperTest
end
end
- def test_principals_check_box_tag_without_avatar
- principals = [User.find(1), Group.find(10)]
- Setting.gravatar_enabled = '1'
- avatar_tags = principals.collect{|p| avatar(p, :size => 16)}
-
- with_settings :gravatar_enabled => '0' do
- tags = principals_check_box_tags(name, principals)
- principals.each_with_index do |principal, i|
- assert_not_include avatar_tags[i], tags
- assert_include content_tag('span', principal_icon(principal), :class => "name icon icon-#{principal.class.name.downcase}"), tags
- end
- end
- end
-
def test_principals_options_for_select_with_users
User.current = nil
users = [User.find(2), User.find(4)]
diff --git a/test/helpers/avatars_helper_test.rb b/test/helpers/avatars_helper_test.rb
index baa64a653..6b426bc98 100644
--- a/test/helpers/avatars_helper_test.rb
+++ b/test/helpers/avatars_helper_test.rb
@@ -63,9 +63,9 @@ class AvatarsHelperTest < Redmine::HelperTest
end
def test_avatar_css_class
- # The default class of the img tag should be gravatar
- assert_include 'class="gravatar"', avatar('jsmith <jsmith@somenet.foo>')
- assert_include 'class="gravatar picture"', avatar('jsmith <jsmith@somenet.foo>', :class => 'picture')
+ # The default classes of the img tag should be gravatar and avatar
+ assert_include 'class="gravatar avatar"', avatar('jsmith <jsmith@somenet.foo>')
+ assert_include 'class="gravatar avatar picture"', avatar('jsmith <jsmith@somenet.foo>', :class => 'picture')
end
def test_avatar_with_initials
@@ -80,9 +80,9 @@ class AvatarsHelperTest < Redmine::HelperTest
end
end
- def test_avatar_disabled
+ def test_avatar_disabled_should_display_user_initials
with_settings :gravatar_enabled => '0' do
- assert_equal '', avatar(User.find_by_mail('jsmith@somenet.foo'))
+ assert_equal "<span role=\"img\" class=\"avatar-color-2 avatar s24\">JS</span>", avatar(User.find_by_mail('jsmith@somenet.foo'))
end
end