mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:34:31 +08:00
FIX: Users can edit posts when they've reached the newuser_max_replies_per_topic
threshold.
This commit is contained in:
@ -31,6 +31,13 @@ describe Validators::PostValidator do
|
||||
expect(post.errors.count).to be > 0
|
||||
end
|
||||
|
||||
it "should be allowed to edit when the user has posted too much" do
|
||||
post.user.stubs(:posted_too_much_in_topic?).returns(true)
|
||||
post.expects(:new_record?).returns(false)
|
||||
validator.max_posts_validator(post)
|
||||
expect(post.errors.count).to be(0)
|
||||
end
|
||||
|
||||
it "should be valid when the user hasn't posted too much" do
|
||||
post.user.expects(:posted_too_much_in_topic?).returns(false)
|
||||
validator.max_posts_validator(post)
|
||||
|
Reference in New Issue
Block a user