Project

General

Profile

Defect #42192 ยป 42192.patch

Go MAEDA, 2025-01-30 10:33

View differences:

app/helpers/icons_helper.rb
end
def principal_icon(principal, **options)
return if principal.nil?
raise ArgumentError, "First argument has to be a Principal, was #{principal.inspect}" unless principal.is_a?(Principal)
principal_class = principal.class.name.downcase
test/helpers/icons_helper_test.rb
assert_nil principal_icon(Principal.find(1))
end
def test_principal_icon_should_not_raise_exception_for_nil
assert_nil principal_icon(nil)
end
def test_activity_event_type_icon_should_return_correct_icon_for_reply_events
expected = %r{<svg class="s18 icon-svg" aria-hidden="true"><use href="/assets/icons-\w+.svg#icon--comments"></use></svg>}
assert_match expected, activity_event_type_icon('reply')
    (1-1/1)