Show comments with hidden authors
In the past, whenever we hid users, we also hid their comments. However, we've now implemented an action to hide users without hiding their comments. In this case, we still want to show the comment, but we weren't doing so.
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<% cache [locale_and_user_status(comment), comment, commentable_cache_key(comment.commentable), comment.author] do %>
|
<% cache [locale_and_user_status(comment), comment, commentable_cache_key(comment.commentable), comment.author] do %>
|
||||||
<div id="<%= dom_id(comment) %>" class="comment small-12">
|
<div id="<%= dom_id(comment) %>" class="comment small-12">
|
||||||
<div class="comment-body">
|
<div class="comment-body">
|
||||||
<% if comment.hidden? || comment.user.hidden? %>
|
<% if comment.hidden? %>
|
||||||
<% if comment.children.size > 0 %>
|
<% if comment.children.size > 0 %>
|
||||||
<div class="callout secondary">
|
<div class="callout secondary">
|
||||||
<p><%= t("comments.comment.deleted") %></p>
|
<p><%= t("comments.comment.deleted") %></p>
|
||||||
|
|||||||
@@ -371,6 +371,16 @@ describe "Commenting debates" do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "Show comment when the author is hidden" do
|
||||||
|
create(:comment, body: "This is pointless", commentable: debate, author: create(:user, :hidden))
|
||||||
|
|
||||||
|
visit debate_path(debate)
|
||||||
|
|
||||||
|
within ".comment", text: "This is pointless" do
|
||||||
|
expect(page).to have_content "User deleted"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
scenario "Errors on reply" do
|
scenario "Errors on reply" do
|
||||||
comment = create(:comment, commentable: debate, user: user)
|
comment = create(:comment, commentable: debate, user: user)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user