Skip to content
This repository was archived by the owner on Mar 25, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions app/presenters/content_item/shareable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ def share_links
text: "Facebook",
icon: "facebook",
},
{
href: twitter_share_url,
text: "Twitter",
icon: "twitter",
},
]
end

Expand All @@ -23,10 +18,6 @@ def facebook_share_url
"https://www.facebook.com/sharer/sharer.php?u=#{share_url}"
end

def twitter_share_url
"https://twitter.com/share?url=#{share_url}&text=#{url_encode(title)}"
end

def share_url
url_encode(Plek.new.website_root + content_item["base_path"])
end
Expand Down
1 change: 0 additions & 1 deletion test/presenters/consultation_presenter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ def schema_name

test "presents share urls with encoded url and title" do
assert_equal "https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fwww.test.gov.uk%2Fgovernment%2Fconsultations%2Fpostgraduate-doctoral-loans", presented_item("open_consultation").share_links[0][:href]
assert_equal "https://twitter.com/share?url=https%3A%2F%2Fwww.test.gov.uk%2Fgovernment%2Fconsultations%2Fpostgraduate-doctoral-loans&text=Postgraduate%20doctoral%20loans", presented_item("open_consultation").share_links[1][:href]
end

test "displays the single page notification button on English pages" do
Expand Down
6 changes: 0 additions & 6 deletions test/presenters/content_item/shareable_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ def expected_path
url_encode("#{Plek.new.website_root}/a/base/path")
end

test "presents the twitter share url" do
expected_twitter_url = "https://twitter.com/share?url=#{expected_path}&text=A%20Title"
actual = DummyContentItem.new.share_links[1][:href]
assert_equal expected_twitter_url, actual
end

test "presents the facebook share url" do
expected_facebook_url = "https://www.facebook.com/sharer/sharer.php?u=#{expected_path}"
actual = DummyContentItem.new.share_links[0][:href]
Expand Down