diff --git a/app/models/domain.rb b/app/models/domain.rb index 8d47cddac..40cde413b 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -17,7 +17,7 @@ class Domain < ActiveRecord::Base has_and_belongs_to_many :nameservers - validates :name_dirty, domain_name: true, uniqueness: { message: I18n.t('errors.messages.epp_domain_taken') } + validates :name_dirty, domain_name: true, uniqueness: { message: :epp_domain_taken } validates :period, numericality: { only_integer: true, greater_than: 0, less_than: 100 } validates :name, :owner_contact, presence: true diff --git a/config/locales/en.yml b/config/locales/en.yml index ddcf9e1fa..760fc980b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -40,7 +40,7 @@ en: name: blank: 'Required parameter missing - name' owner_contact: - blank: 'Required parameter missing - owner contact' + blank: 'Required parameter missing - registrant' admin_contacts: blank: 'Required parameter missing - admin contact' @@ -51,4 +51,4 @@ en: epp_domain_taken: 'Domain name already exists' epp_obj_does_not_exist: 'Object does not exist' epp_command_failed: 'Command failed' - epp_contact_not_found: "Contact was not found" + epp_contact_not_found: 'Contact was not found' diff --git a/spec/epp/domain_spec.rb b/spec/epp/domain_spec.rb index 02339efe3..db8a73d39 100644 --- a/spec/epp/domain_spec.rb +++ b/spec/epp/domain_spec.rb @@ -62,6 +62,7 @@ describe 'EPP Domain', epp: true do it 'does not create domain without contacts and registrant' do response = epp_request('domains/create_wo_contacts_and_registrant.xml') expect(response[:result_code]).to eq('2306') + expect(response[:msg]).to eq('Required parameter missing - registrant') end end diff --git a/spec/models/domain_spec.rb b/spec/models/domain_spec.rb index 517f752a8..cfe4f601e 100644 --- a/spec/models/domain_spec.rb +++ b/spec/models/domain_spec.rb @@ -41,7 +41,7 @@ describe Domain do expect(d.errors.messages).to match_array({ name: ['Required parameter missing - name'], period: ['is not a number'], - owner_contact: ['Required parameter missing - owner contact'] + owner_contact: ['Required parameter missing - registrant'] }) end