BURs: refactor implication wiki page validations.

Move the validation that the tags in an implication must have wiki pages
back into the TagImplication model. Use validation contexts to only run
the validation when the BUR is created, not when the BUR is approved.
This commit is contained in:
evazion
2020-12-02 14:30:18 -06:00
parent b7b15b3d95
commit 6275e85148
4 changed files with 23 additions and 16 deletions

View File

@@ -335,7 +335,7 @@ class BulkUpdateRequestTest < ActiveSupport::TestCase
@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)
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
end