change daily flag limit to 5/day

This commit is contained in:
r888888888
2017-03-16 14:32:04 -07:00
parent d9a26975ba
commit e7b3fae215
3 changed files with 36 additions and 8 deletions

View File

@@ -48,13 +48,13 @@ class PostFlagTest < ActiveSupport::TestCase
assert_equal(["You have already flagged this post"], @post_flag.errors.full_messages)
end
should "not be able to flag more than 10 posts in 24 hours" do
should "not be able to flag more than 5 posts in 24 hours" do
@post_flag = PostFlag.new(:post => @post, :reason => "aaa", :is_resolved => false)
@post_flag.expects(:flag_count_for_creator).returns(10)
@post_flag.expects(:flag_count_for_creator).returns(5)
assert_difference("PostFlag.count", 0) do
@post_flag.save
end
assert_equal(["You can flag 10 posts a day"], @post_flag.errors.full_messages)
assert_equal(["You can flag 5 posts a day"], @post_flag.errors.full_messages)
end
should "not be able to flag a deleted post" do