Skip to content

Commit

Permalink
AO3-6739 Display moderated commenting notice on individual chapters (o…
Browse files Browse the repository at this point in the history
…twcode#4859)

* AO3-6739 Extend tests to cover moderation message on chapters

* AO3-6739 Display moderated commenting notice on chapters
  • Loading branch information
sarken authored Jun 19, 2024
1 parent 231c34e commit 325f5de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
9 changes: 5 additions & 4 deletions app/views/comments/_comment_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@

<% if comments_are_moderated(commentable) && !current_user_is_work_creator(commentable) %>
<p class="notice">
<%# i18n-tasks-use
t("comments.commentable.permissions.moderated_commenting.notice.admin_post")
t("comments.commentable.permissions.moderated_commenting.notice.work") %>
<%= t("comments.commentable.permissions.moderated_commenting.notice.#{commentable.model_name.i18n_key}") %>
<% if commentable.is_a?(AdminPost) %>
<%= t("comments.commentable.permissions.moderated_commenting.notice.admin_post") %>
<% else %>
<%= t("comments.commentable.permissions.moderated_commenting.notice.work") %>
<% end %>
</p>
<% end %>

Expand Down
7 changes: 5 additions & 2 deletions features/comments_and_kudos/comment_moderation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ Feature: Comment Moderation
And I set up the draft "Moderation"
And I check "Enable comment moderation"
And I post the work without preview
And I post a chapter for the work "Moderation"
Then comment moderation should be enabled on "Moderation"
When I am logged in as "commenter"
And I view the work "Moderation"
Then I should see "has chosen to moderate comments"
And I go to the work "Moderation" in full mode
Then I should see "This work's creator has chosen to moderate comments on the work. Your comment will not appear until it has been approved by the creator."
When I go to the 2nd chapter of the work "Moderation"
Then I should see "This work's creator has chosen to moderate comments on the work. Your comment will not appear until it has been approved by the creator."

Scenario: Post a moderated comment
Given the moderated work "Moderation" by "author"
Expand Down

0 comments on commit 325f5de

Please sign in to comment.