For example I would like to validate that name is letters only and is between 4 and 14 letters length. I have the following code in model:validates: name, :format => { :with => /^[a-zA-Z]+$/,                              :message => 'Name should be letters only. },                 :length => { :minimum => 4, :maximum => 14 }So it clearly lets me do what I want.But as for unit tests, I have a bit too much perfectionism so I set something likeinvalid_names = ['1234',                 'qwe',                 '1%#$#$',                 'Sam1',                 '%',                 random_string(15)] #I also have a test method to create random string with parametrized lengthvalid_names = %w['test',                 'Travis',                 'John',                 random_string(5),                 random_string(14),                 random_string(4)]and test each of them in a loop with asserts, likeinvalid_names.each do |name|    user = User.new(:name => name)    user.save    assert user.errors[:name].any?, #{name} is valid.endSo it definitely works great. But it is too verbose (because of valid/invalid names arrays, and added random_string method), also I can't be sure my test actually tests all symbols and their combinations possible and all lengths and stuff, even though I am definitely sure it works as expected.   So what is acceptable way to test my validation without being too much perfectionist, yet to leave most part of logic tested?    Am I just set in a mind trick of trying to write a perfect code just to write a perfect code and forgetting about main finish goal: working product?
How do I test my validation without being too much perfectionist, yet to leave most part of logic tested?
unit testing