mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 09:43:36 +02:00
parent
4e6d576b67
commit
658bf6dda2
3 changed files with 2 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
class Contact::Ident::NationalIDValidator < ActiveModel::EachValidator
|
class Contact::Ident::NationalIdValidator < ActiveModel::EachValidator
|
||||||
def self.country_specific_validations
|
def self.country_specific_validations
|
||||||
{
|
{
|
||||||
Country.new('EE') => proc { |code| Isikukood.new(code).valid? },
|
Country.new('EE') => proc { |code| Isikukood.new(code).valid? },
|
||||||
|
|
|
@ -12,5 +12,4 @@
|
||||||
|
|
||||||
ActiveSupport::Inflector.inflections(:en) do |inflect|
|
ActiveSupport::Inflector.inflections(:en) do |inflect|
|
||||||
inflect.acronym 'DNS'
|
inflect.acronym 'DNS'
|
||||||
inflect.acronym 'ID'
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -117,7 +117,7 @@ RSpec.describe 'EPP contact:create' do
|
||||||
Country.new('DE') => proc { false },
|
Country.new('DE') => proc { false },
|
||||||
}
|
}
|
||||||
|
|
||||||
allow(Contact::Ident::NationalIDValidator).to receive(:country_specific_validations)
|
allow(Contact::Ident::NationalIdValidator).to receive(:country_specific_validations)
|
||||||
.and_return(country_specific_validations)
|
.and_return(country_specific_validations)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue