Project

General

Profile

Defect #33355 » diff.patch

Mizuki ISHIKAWA, 2020-04-28 06:38

View differences:

app/helpers/avatars_helper.rb
54 54
      elsif user.is_a?(Group)
55 55
        group_avatar(options)
56 56
      else
57
        nil
57
        ''
58 58
      end
59 59
    else
60 60
      ''
test/helpers/avatars_helper_test.rb
46 46
    assert_match %r{src="/images/group.png(\?\d+)?"}, avatar(Group.first)
47 47
  end
48 48

  
49
  def test_avatar_with_invalid_arg_should_return_nil
50
    assert_nil avatar('jsmith')
51
    assert_nil avatar(nil)
49
  def test_avatar_with_invalid_arg_should_return_empty_string
50
    assert_equal '', avatar('jsmith')
51
    assert_equal '', avatar(nil)
52 52
  end
53 53

  
54 54
  def test_avatar_default_size_should_be_24
(1-1/2)