Add comments count component

Remove all the translations that are left over after having unified them
in the component.
This commit is contained in:
taitus
2022-08-16 12:46:08 +02:00
parent aec317e5e6
commit 2865ee286f
29 changed files with 115 additions and 174 deletions

View File

@@ -0,0 +1,17 @@
require "rails_helper"
describe Shared::CommentsCountComponent do
it "renders a link when a URL is given" do
render_inline Shared::CommentsCountComponent.new(0, url: "http://www.url.com")
expect(page.find(".comments-count")).to have_content "No comments"
expect(page.find(".comments-count")).to have_link "No comments", href: "http://www.url.com"
end
it "renders plain text when no URL is given" do
render_inline Shared::CommentsCountComponent.new(1)
expect(page.find(".comments-count")).to have_content "1 comment"
expect(page.find(".comments-count")).not_to have_link "1 comment"
end
end