add additional mod actions

This commit is contained in:
Albert Yi
2017-01-03 16:02:36 -08:00
parent 4d698bf98b
commit b9a1e115fb
7 changed files with 54 additions and 3 deletions

View File

@@ -14,7 +14,6 @@ class CommentTest < ActiveSupport::TestCase
CurrentUser.ip_addr = nil
end
context "that mentions a user" do
setup do
@post = FactoryGirl.create(:post)
@@ -206,6 +205,21 @@ class CommentTest < ActiveSupport::TestCase
assert_equal(c1.id, matches.all[1].id)
end
context "that is edited by a moderator" do
setup do
@post = FactoryGirl.create(:post)
@comment = FactoryGirl.create(:comment, :post_id => @post.id)
@mod = FactoryGirl.create(:moderator_user)
CurrentUser.user = @mod
end
should "create a mod action" do
assert_difference("ModAction.count") do
@comment.update_attributes({:body => "nope"}, :as => :moderator)
end
end
end
context "that is below the score threshold" do
should "be hidden if not stickied" do
user = FactoryGirl.create(:user, :comment_threshold => 0)