Convert social share helper library into a real helper
This commit is contained in:
parent
a012c5ecee
commit
2a5e35c716
3 changed files with 34 additions and 45 deletions
|
@ -2,7 +2,6 @@ require "test_helper"
|
|||
|
||||
class SocialShareButtonHelperTest < ActionView::TestCase
|
||||
include SocialShareButtonHelper
|
||||
include ApplicationHelper
|
||||
|
||||
def setup
|
||||
@options = {
|
||||
|
@ -34,15 +33,4 @@ class SocialShareButtonHelperTest < ActionView::TestCase
|
|||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue