diff --git a/app/helpers/avatars_helper.rb b/app/helpers/avatars_helper.rb index eb3f01138..da39260da 100644 --- a/app/helpers/avatars_helper.rb +++ b/app/helpers/avatars_helper.rb @@ -54,7 +54,7 @@ module AvatarsHelper elsif user.is_a?(Group) group_avatar(options) else - nil + '' end else '' diff --git a/test/helpers/avatars_helper_test.rb b/test/helpers/avatars_helper_test.rb index db75e5f7d..c2d2cfa77 100644 --- a/test/helpers/avatars_helper_test.rb +++ b/test/helpers/avatars_helper_test.rb @@ -46,9 +46,9 @@ class AvatarsHelperTest < Redmine::HelperTest assert_match %r{src="/images/group.png(\?\d+)?"}, avatar(Group.first) end - def test_avatar_with_invalid_arg_should_return_nil - assert_nil avatar('jsmith') - assert_nil avatar(nil) + def test_avatar_with_invalid_arg_should_return_empty_string + assert_equal '', avatar('jsmith') + assert_equal '', avatar(nil) end def test_avatar_default_size_should_be_24