27 lines
723 B
Ruby
27 lines
723 B
Ruby
require 'test_helper'
|
|
|
|
module Moderator
|
|
module Post
|
|
class ApprovalsControllerTest < ActionController::TestCase
|
|
context "The moderator post approvals controller" do
|
|
setup do
|
|
@admin = Factory.create(:admin_user)
|
|
CurrentUser.user = @admin
|
|
CurrentUser.ip_addr = "127.0.0.1"
|
|
|
|
@post = Factory.create(:post, :is_pending => true)
|
|
end
|
|
|
|
context "create action" do
|
|
should "render" do
|
|
post :create, {:post_id => @post.id, :format => "js"}, {:user_id => @admin.id}
|
|
assert_response :success
|
|
@post.reload
|
|
assert(!@post.is_pending?)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|