comments: allow new users to comment.

Remove the rule that users less than a week old can't leave comments.
This commit is contained in:
evazion
2020-03-21 22:23:29 -05:00
parent aefbed57b8
commit 63f7311489
9 changed files with 4 additions and 50 deletions

View File

@@ -17,7 +17,6 @@ class CommentTest < ActiveSupport::TestCase
setup do
@post = FactoryBot.create(:post)
Danbooru.config.stubs(:member_comment_limit).returns(100)
Danbooru.config.stubs(:member_comment_time_threshold).returns(1.week.from_now)
end
context "added in an edit" do
@@ -82,24 +81,9 @@ class CommentTest < ActiveSupport::TestCase
end
end
context "created by a limited user" do
setup do
Danbooru.config.stubs(:member_comment_limit).returns(5)
Danbooru.config.stubs(:member_comment_time_threshold).returns(1.week.ago)
end
should "fail creation" do
post = FactoryBot.create(:post)
comment = FactoryBot.build(:comment, post: post)
comment.save
assert_equal(["You can not post comments within 1 week of sign up"], comment.errors.full_messages)
end
end
context "created by an unlimited user" do
setup do
Danbooru.config.stubs(:member_comment_limit).returns(100)
Danbooru.config.stubs(:member_comment_time_threshold).returns(1.week.from_now)
end
context "that is then deleted" do