BURs: impose a maximum size limit on BURs.

Enforce a maximum size limit of 100 lines per BUR. Larger BURs should be
split into smaller chunks.
This commit is contained in:
evazion
2020-12-03 14:34:43 -06:00
parent 8a959b44df
commit 19adf92a39
2 changed files with 17 additions and 0 deletions

View File

@@ -373,6 +373,15 @@ class BulkUpdateRequestTest < ActiveSupport::TestCase
assert_equal(["Can't create implication a -> b ('a' must have a wiki page; 'b' must have a wiki page)"], @bur.errors.full_messages)
end
end
context "a bulk update request that is too long" do
should "fail" do
@bur = build(:bulk_update_request, script: "nuke touhou\n" * 200)
assert_equal(false, @bur.valid?)
assert_equal(["Bulk update request is too long (maximum size: 100 lines). Split your request into smaller chunks and try again."], @bur.errors.full_messages)
end
end
end
context "when the script is updated" do