Revert "Merge pull request #2074 from internetee/1795-validation-contacts-name"

This reverts commit e2116a505e, reversing
changes made to ded22685c9.
This commit is contained in:
Keijo Raamat 2021-07-12 19:22:17 +03:00
parent b0df8f230e
commit 46479dc31b
2 changed files with 0 additions and 15 deletions

View file

@ -28,12 +28,7 @@ class Contact < ApplicationRecord
.where('success = false and verified_at IS NOT NULL')
}
NAME_REGEXP = /([\u00A1-\u00B3\u00B5-\u00BF\u0021-\u0026\u0028-\u002C\u003A-\u0040]|
[\u005B-\u005F\u007B-\u007E\u2040-\u206F\u20A0-\u20BF\u2100-\u218F])/x.freeze
validates :name, :email, presence: true
validates :name, format: { without: NAME_REGEXP, message: :invalid }
validates :street, :city, :zip, :country_code, presence: true, if: lambda {
self.class.address_processing?
}

View file

@ -32,16 +32,6 @@ class ContactTest < ActiveJob::TestCase
assert contact.invalid?
end
def test_allowed_and_disallowed_symbols_for_name
contact = valid_contact
contact.name = 'MARY ÄNN OCONNEŽ-ŠUSLIK'
assert contact.valid?
contact.name = 'Boğaçhan Çağlayan'
assert contact.valid?
contact.name = '# "¤ #" ¤ "?'
assert contact.invalid?
end
def test_validates_code_format
contact = valid_contact.dup
max_length = 100