artists: add more invalid name tests (#3901).

This commit is contained in:
evazion
2018-09-14 13:32:45 -05:00
parent bbb233b93f
commit 761f2649af
2 changed files with 7 additions and 6 deletions

View File

@@ -56,10 +56,12 @@ class ArtistTest < ActiveSupport::TestCase
assert(@artist.urls[0].is_active?)
end
should "should have a valid name" do
@artist = Artist.new(:name => "-blah")
@artist.save
assert_equal(["Name '-blah' cannot begin with a dash ('-')"], @artist.errors.full_messages)
context "with an invalid name" do
subject { FactoryBot.build(:artist) }
should_not allow_value("-blah").for(:name)
should_not allow_value("_").for(:name)
should_not allow_value("").for(:name)
end
context "with a matching tag alias" do