#1448, add specs
This commit is contained in:
parent
e7f2582f59
commit
6d1a8c92ec
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue