BURs: remove ability to skip secondary validations.

Remove the ability to skip secondary validations when creating a BUR.
The only skippable validation that still existed was the requirement
that both tags in an implication must have wiki pages. It's now
mandatory to write wiki pages for tags before you can request an
implication. This doesn't apply to empty tags.
This commit is contained in:
evazion
2020-11-12 20:08:13 -06:00
parent 25cba710bf
commit 7f90bc4216
13 changed files with 38 additions and 65 deletions

View File

@@ -309,6 +309,24 @@ class BulkUpdateRequestTest < ActiveSupport::TestCase
assert_equal(true, @bur.valid?)
end
end
context "requesting an implication for an empty tag without a wiki" do
should "succeed" do
@bur = create(:bulk_update_request, script: "imply a -> b")
assert_equal(true, @bur.valid?)
end
end
context "requesting an implication for a populated tag without a wiki" do
should "fail" do
create(:tag, name: "a", post_count: 1)
create(:tag, name: "b", post_count: 1)
@bur = build(:bulk_update_request, script: "imply a -> b")
assert_equal(false, @bur.valid?)
assert_equal(["'a' must have a wiki page; 'b' must have a wiki page"], @bur.errors.full_messages)
end
end
end
context "when the script is updated" do