add additional mod actions
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user