diff --git a/app/views/posts/partials/show/_notices.html.erb b/app/views/posts/partials/show/_notices.html.erb index 8a1e37a51..77ded1850 100644 --- a/app/views/posts/partials/show/_notices.html.erb +++ b/app/views/posts/partials/show/_notices.html.erb @@ -25,9 +25,9 @@ <% elsif post.is_deleted? %>
- <% if post.flags.any? %> -

This post was deleted for the following reasons:

- <%= render "post_flags/reasons", flags: post.flags %> + <% if post.flags.succeeded.last.present? %> +

This post was deleted for the following reason:

+ <%= render "post_flags/reasons", flag: post.flags.succeeded.last %> <% else %>

This post was deleted

<% end %> diff --git a/test/functional/posts_controller_test.rb b/test/functional/posts_controller_test.rb index 89431f69d..d0f36c3f3 100644 --- a/test/functional/posts_controller_test.rb +++ b/test/functional/posts_controller_test.rb @@ -540,6 +540,15 @@ class PostsControllerTest < ActionDispatch::IntegrationTest end end + context "a deleted post" do + should "render" do + @post.delete!("no", user: @user) + get post_path(@post) + + assert_response :success + end + end + context "with pools" do should "render the pool list" do as(@user) { @post.update(tag_string: "newpool:comic") }