This commit is contained in:
Ahmed Ejaz 2023-11-12 03:08:14 +05:00 committed by Andreas Nedbal
parent e7f2582f59
commit 6d1a8c92ec
2 changed files with 15 additions and 1 deletions

View file

@ -30,4 +30,14 @@ describe SocialHelper, type: :helper do
URL
end
end
describe "#answer_copy_content" do
subject { answer_copy_content(answer) }
it "returns a formatted content to copy" do
expectedContent = "#{answer.question.content} - #{answer.content} [https://example.com/@#{answer.user.screen_name}/a/#{answer.id}]"
expect(subject).to eq(expectedContent)
end
end
end

View file

@ -24,6 +24,10 @@ describe "actions/_share.html.haml", type: :view do
end
it "has a dropdown item to share to anywhere else" do
expect(rendered).to have_css(%(a.dropdown-item[data-controller="share"]))
expect(rendered).to have_css(%(a.dropdown-item[data-action="share#share"]))
end
it "has a dropdown item to copy to clipboard" do
expect(rendered).to have_css(%(a.dropdown-item[data-action="share#copyToClipboard"]))
end
end