wikis: don't allow adding other names to artist wikis.

Prevent users from adding other names to artist wikis. These should be
added to the artist entry instead.
This commit is contained in:
evazion
2020-12-19 14:42:49 -06:00
parent 4cb39422b2
commit 7708e2e08f
3 changed files with 22 additions and 1 deletions

View File

@@ -77,5 +77,15 @@ class WikiPageTest < ActiveSupport::TestCase
assert_equal(0, @wiki_page.dtext_links.size)
end
end
context "with other names" do
should "not allow artist wikis to have other names" do
tag = create(:artist_tag)
wiki = build(:wiki_page, title: tag.name, other_names: ["blah"])
assert_equal(false, wiki.valid?)
assert_equal(["An artist wiki can't have other names"], wiki.errors[:base])
end
end
end
end