users: remove no_flagging and no_feedback permissions.

This commit is contained in:
evazion
2019-12-24 10:24:15 -06:00
parent 939c168fe9
commit 7694be9cb3
8 changed files with 5 additions and 82 deletions

View File

@@ -166,22 +166,5 @@ class PostFlagTest < ActiveSupport::TestCase
end
end
end
context "a user with no_flag=true" do
setup do
travel_to(2.weeks.ago) do
@bob = create(:user, no_flagging: true)
end
end
should "not be able to flag more than 1 post in 24 hours" do
@post_flag = PostFlag.new(post: @post, reason: "aaa", is_resolved: false)
@post_flag.expects(:flag_count_for_creator).returns(1)
assert_difference("PostFlag.count", 0) do
as(@bob) { @post_flag.save }
end
assert_equal(["You cannot flag posts"], @post_flag.errors.full_messages.grep(/cannot flag posts/))
end
end
end
end

View File

@@ -37,19 +37,6 @@ class UserFeedbackTest < ActiveSupport::TestCase
assert_equal(["You cannot submit feedback for yourself"], feedback.errors.full_messages)
end
context "with a no_feedback user" do
setup do
@gold_user = FactoryBot.create(:gold_user, no_feedback: true)
CurrentUser.user = @gold_user
end
should "not validate" do
feedback = FactoryBot.build(:user_feedback, :user => @gold_user)
feedback.save
assert_equal(["You cannot submit feedback"], feedback.errors.full_messages.grep(/^You cannot submit feedback$/))
end
end
should "not validate if the creator is not gold" do
user = FactoryBot.create(:user)
gold = FactoryBot.create(:gold_user)