Files
danbooru/test/functional/post_approvals_controller_test.rb
evazion f47c56d976 approvals: move post approval endpoint to /post_approvals.
Move the post approval endpoint from `POST /moderator/post/approval` to
`POST /post_approvals`.
2020-02-20 15:49:18 -06:00

28 lines
665 B
Ruby

require 'test_helper'
class PostApprovalsControllerTest < ActionDispatch::IntegrationTest
context "The post approvals controller" do
setup do
@approver = create(:approver)
end
context "create action" do
should "render" do
@post = create(:post, is_pending: true)
post_auth post_approvals_path(post_id: @post.id, format: :js), @approver
assert_response :success
assert(!@post.reload.is_pending?)
end
end
context "index action" do
should "render" do
@approval = create(:post_approval)
get post_approvals_path
assert_response :success
end
end
end
end