Project

General

Profile

Defect #33355 » diff.patch

Mizuki ISHIKAWA, 2020-04-28 06:38

View differences:

app/helpers/avatars_helper.rb
elsif user.is_a?(Group)
group_avatar(options)
else
nil
''
end
else
''
test/helpers/avatars_helper_test.rb
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
(1-1/2)