mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 19:20:37 +02:00
Merge pull request #1208 from internetee/make-registrar-address-state-and-zip-optional
Make registrar address zip and state optional
This commit is contained in:
commit
eed255fa20
7 changed files with 27 additions and 24 deletions
|
@ -93,16 +93,22 @@ class RegistrarTest < ActiveSupport::TestCase
|
|||
Setting.days_to_keep_invoices_active = @original_days_to_keep_invoices_active_setting
|
||||
end
|
||||
|
||||
def test_invalid_without_address
|
||||
def test_invalid_without_address_street
|
||||
registrar = valid_registrar
|
||||
address_parts = %i[street zip city state country_code]
|
||||
registrar.address_street = ''
|
||||
assert registrar.invalid?
|
||||
end
|
||||
|
||||
address_parts.each do |address_part|
|
||||
attribute_name = "address_#{address_part}"
|
||||
registrar.public_send("#{attribute_name}=", '')
|
||||
assert registrar.invalid?, "#{attribute_name} should be required"
|
||||
registrar.public_send("#{attribute_name}=", 'some')
|
||||
end
|
||||
def test_invalid_without_address_city
|
||||
registrar = valid_registrar
|
||||
registrar.address_city = ''
|
||||
assert registrar.invalid?
|
||||
end
|
||||
|
||||
def test_invalid_without_address_country_code
|
||||
registrar = valid_registrar
|
||||
registrar.address_country_code = ''
|
||||
assert registrar.invalid?
|
||||
end
|
||||
|
||||
def test_full_address
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue