Fix #3363: Prevent setting tags to invalid categories.

This commit is contained in:
evazion
2017-11-13 16:54:18 -06:00
parent 40bd313ac4
commit 6fbd7c23e1
3 changed files with 10 additions and 1 deletions

View File

@@ -119,6 +119,10 @@ class TagTest < ActiveSupport::TestCase
tag.update_category_cache_for_all
assert_equal(Tag.categories.copyright, Cache.get("tc:#{Cache.hash(tag.name)}"))
end
context "not be settable to an invalid category" do
should validate_inclusion_of(:category).in_array(TagCategory.category_ids)
end
end
context "A tag parser" do