3 class SocialShareButtonHelperTest < ActionView::TestCase
4 include SocialShareButtonHelper
8 :allow_sites => %w[x facebook linkedin],
9 :title => "Test Title",
10 :url => "https://example.com",
11 :desc => "Test Description",
16 def test_render_social_share_buttons_with_valid_sites
17 result = render_social_share_buttons(@options)
18 assert_includes result, "x"
19 assert_includes result, "facebook"
20 assert_includes result, "linkedin"
23 def test_render_social_share_buttons_with_invalid_site
24 @options[:allow_sites] << "invalid_site"
25 result = render_social_share_buttons(@options)
26 assert_not_includes result, "invalid_site"
29 def test_render_social_share_buttons_with_no_sites
30 @options[:allow_sites] = []
31 result = render_social_share_buttons(@options)
32 SocialShareButtonHelper::SOCIAL_SHARE_CONFIG.each_key do |site|
33 assert_includes result, site.to_s # Convert symbol to string