diff --git a/app/controllers/post_disapprovals_controller.rb b/app/controllers/post_disapprovals_controller.rb index f4d9cb803..ad9e80dce 100644 --- a/app/controllers/post_disapprovals_controller.rb +++ b/app/controllers/post_disapprovals_controller.rb @@ -18,6 +18,14 @@ class PostDisapprovalsController < ApplicationController respond_with(@post_disapprovals) end + def show + @post_disapproval = authorize PostDisapproval.find(params[:id]) + + respond_with(@post_disapproval) do |format| + format.html { redirect_to post_disapprovals_path(search: { id: @post_disapproval.id }) } + end + end + def edit @post_disapproval = authorize PostDisapproval.find(params[:id]) respond_with(@post_disapproval) diff --git a/app/views/post_events/index.html.erb b/app/views/post_events/index.html.erb index 1241d0864..5c22d933e 100644 --- a/app/views/post_events/index.html.erb +++ b/app/views/post_events/index.html.erb @@ -117,10 +117,8 @@ <% end %> <% end %> - <% if policy(event).can_see_creator? %> - <% menu.item do %> - <%= link_to "Details", event.model %> - <% end %> + <% menu.item do %> + <%= link_to "Details", event.model %> <% end %> <% end %> <% end %> diff --git a/test/functional/post_disapprovals_controller_test.rb b/test/functional/post_disapprovals_controller_test.rb index 7ae7a9cf1..8b28cf7cc 100644 --- a/test/functional/post_disapprovals_controller_test.rb +++ b/test/functional/post_disapprovals_controller_test.rb @@ -86,6 +86,24 @@ class PostDisapprovalsControllerTest < ActionDispatch::IntegrationTest end end + context "show action" do + setup do + @disapproval = create(:post_disapproval) + end + + should "render for html" do + get post_disapproval_path(@disapproval) + + assert_redirected_to post_disapprovals_path(search: { id: @disapproval.id }) + end + + should "render for json" do + get post_disapproval_path(@disapproval), as: :json + + assert_response :success + end + end + context "update action" do setup do @post = create(:post, is_pending: true)