Fix #5231: "Reason is too long" notice does not appear when editing an appeal

This commit is contained in:
evazion
2022-08-24 14:27:00 -05:00
parent d01b3c0637
commit c2597ff299
6 changed files with 50 additions and 8 deletions

View File

@@ -150,6 +150,13 @@ class PostFlagsControllerTest < ActionDispatch::IntegrationTest
assert_equal("no", @post_flag.reload.reason)
end
should "return an error if the flag is too long" do
put_auth post_flag_path(@post_flag), @flagger, params: { post_flag: { reason: "x"*1000 }}
assert_response :success
assert_equal("xxx", @post_flag.reload.reason)
end
should "not allow the flagger to update a resolved flag" do
@post_flag.update!(status: "rejected")
put_auth post_flag_path(@post_flag), @flagger, params: { post_flag: { reason: "no" }}