Files
danbooru/test/functional/moderator/post/approvals_controller_test.rb
2011-07-22 13:35:40 -04:00

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