approvals: move post approval endpoint to /post_approvals.
Move the post approval endpoint from `POST /moderator/post/approval` to `POST /post_approvals`.
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
require 'test_helper'
|
||||
|
||||
module Moderator
|
||||
module Post
|
||||
class ApprovalsControllerTest < ActionDispatch::IntegrationTest
|
||||
context "The moderator post approvals controller" do
|
||||
setup do
|
||||
@admin = create(:admin_user)
|
||||
as_admin do
|
||||
@post = create(:post, :is_pending => true)
|
||||
end
|
||||
end
|
||||
|
||||
context "create action" do
|
||||
should "render" do
|
||||
post_auth moderator_post_approval_path, @admin, params: {:post_id => @post.id, :format => "js"}
|
||||
assert_response :success
|
||||
@post.reload
|
||||
assert(!@post.is_pending?)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -3,11 +3,22 @@ require 'test_helper'
|
||||
class PostApprovalsControllerTest < ActionDispatch::IntegrationTest
|
||||
context "The post approvals controller" do
|
||||
setup do
|
||||
@approval = FactoryBot.create(:post_approval)
|
||||
@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
|
||||
|
||||
Reference in New Issue
Block a user