Fix #3448: Lower the limit for tag category changes.

Also allow admins to bypass all restrictions.
This commit is contained in:
evazion
2017-12-23 13:19:36 -06:00
parent 2385933e56
commit 91592b2f18
3 changed files with 26 additions and 3 deletions

View File

@@ -73,6 +73,14 @@ class TagsControllerTest < ActionController::TestCase
@tag.reload
assert_equal(1, @tag.category)
end
should "not change category when the tag is too large to be changed by a builder" do
@tag.update_columns(post_count: 1001)
post :update, {:id => @tag.id, :tag => {:category => "1"}}, {:user_id => @user.id}
assert_response :forbidden
assert_equal(0, @tag.reload.category)
end
end
end
end