diff --git a/app/models/user.rb b/app/models/user.rb index d73e89412..577361a4d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -356,7 +356,7 @@ class User < ApplicationRecord def is_flag_limited? return false if has_unlimited_flags? - post_flags.pending.count >= 10 + post_flags.pending.count >= 5 end # Flags are unlimited if you're an approver or you have at least 30 flags diff --git a/test/unit/post_flag_test.rb b/test/unit/post_flag_test.rb index b90d83211..88f4979f9 100644 --- a/test/unit/post_flag_test.rb +++ b/test/unit/post_flag_test.rb @@ -21,15 +21,15 @@ class PostFlagTest < ActiveSupport::TestCase assert_equal(false, @user.is_flag_limited?) assert_nothing_raised do - create_list(:post_flag, 11, creator: @user, status: :pending) + create_list(:post_flag, 6, creator: @user, status: :pending) end end end context "a basic user" do - should "be able to flag up to 10 posts" do + should "be able to flag up to 5 posts" do @user = create(:user) - @flags = create_list(:post_flag, 10, creator: @user, status: :pending) + @flags = create_list(:post_flag, 5, creator: @user, status: :pending) @flag = build(:post_flag, creator: @user, status: :pending) assert_equal(false, @flag.valid?)