class SocialShareButtonHelperTest < ActionView::TestCase
include SocialShareButtonHelper
- include ApplicationHelper
def setup
@options = {
assert_includes result, site.to_s # Convert symbol to string
end
end
-
- def test_filter_allowed_sites
- valid_sites, invalid_sites = SocialShareButtonHelper.filter_allowed_sites(%w[x facebook invalid_site])
- assert_equal %w[x facebook], valid_sites
- assert_equal %w[invalid_site], invalid_sites
- end
-
- def test_icon_path
- assert_equal "social_icons/x.svg", SocialShareButtonHelper.icon_path("x")
- assert_equal "", SocialShareButtonHelper.icon_path("invalid_site")
- end
end