#1448, add specs
This commit is contained in:
parent
e7f2582f59
commit
6d1a8c92ec
|
@ -30,4 +30,14 @@ describe SocialHelper, type: :helper do
|
||||||
URL
|
URL
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|
|
@ -24,6 +24,10 @@ describe "actions/_share.html.haml", type: :view do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has a dropdown item to share to anywhere else" do
|
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
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue