mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +02:00
Contact name validation
This commit is contained in:
parent
18983ab164
commit
bdd25f34ca
2 changed files with 2 additions and 2 deletions
|
@ -1,7 +1,6 @@
|
||||||
class Contact < ActiveRecord::Base
|
class Contact < ActiveRecord::Base
|
||||||
# TODO: Foreign contact will get email with activation link/username/temp password
|
# TODO: Foreign contact will get email with activation link/username/temp password
|
||||||
# TODO: Phone number validation, in first phase very minimam in order to support current registries
|
# TODO: Phone number validation, in first phase very minimam in order to support current registries
|
||||||
# TODO: Validate presence of name
|
|
||||||
|
|
||||||
include EppErrors
|
include EppErrors
|
||||||
|
|
||||||
|
@ -18,7 +17,7 @@ class Contact < ActiveRecord::Base
|
||||||
|
|
||||||
accepts_nested_attributes_for :address, :disclosure
|
accepts_nested_attributes_for :address, :disclosure
|
||||||
|
|
||||||
validates :phone, :email, :ident, :address, :registrar, presence: true
|
validates :name, :phone, :email, :ident, :address, :registrar, presence: true
|
||||||
|
|
||||||
validate :ident_must_be_valid
|
validate :ident_must_be_valid
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ describe Contact do
|
||||||
expect(@contact.valid?).to eq false
|
expect(@contact.valid?).to eq false
|
||||||
|
|
||||||
expect(@contact.errors.messages).to match_array({
|
expect(@contact.errors.messages).to match_array({
|
||||||
|
name: ['Required parameter missing - name'],
|
||||||
phone: ['Required parameter missing - phone', 'Phone nr is invalid'],
|
phone: ['Required parameter missing - phone', 'Phone nr is invalid'],
|
||||||
email: ['Required parameter missing - email', 'Email is invalid'],
|
email: ['Required parameter missing - email', 'Email is invalid'],
|
||||||
ident: ['Required parameter missing - ident'],
|
ident: ['Required parameter missing - ident'],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue