Fix Setting fixtures, correct seed.rb

This commit is contained in:
Karl Erik Õunapuu 2020-08-12 11:29:33 +03:00
parent ee602db93b
commit 4c9fc76283
4 changed files with 137 additions and 15 deletions

View file

@ -57,7 +57,7 @@ ActiveRecord::Base.transaction do
SettingEntry.create(code: 'registry_zip', value: '10617', format: 'string', group: 'contacts') SettingEntry.create(code: 'registry_zip', value: '10617', format: 'string', group: 'contacts')
SettingEntry.create(code: 'registry_juridical_name', value: 'Eesti Interneti SA', format: 'string', group: 'contacts') SettingEntry.create(code: 'registry_juridical_name', value: 'Eesti Interneti SA', format: 'string', group: 'contacts')
SettingEntry.create(code: 'address_processing', value: 'true', format: 'boolean', group: 'other') SettingEntry.create(code: 'address_processing', value: 'true', format: 'boolean', group: 'other')
SettingEntry.create(code: 'directo_monthly_number_last', value: '309909', format: 'integer', group: 'billing') SettingEntry.create(code: 'directo_monthly_number_last', value: '309901', format: 'integer', group: 'billing')
SettingEntry.create(code: 'dispute_period_in_months', value: '36', format: 'integer', group: 'other') SettingEntry.create(code: 'dispute_period_in_months', value: '36', format: 'integer', group: 'other')
SettingEntry.create(code: 'registry_whois_disclaimer', value: 'Search results may not be used for commercial, advertising, recompilation, repackaging, redistribution, reuse, obscuring or other similar activities.', format: 'string', group: 'contacts') SettingEntry.create(code: 'registry_whois_disclaimer', value: 'Search results may not be used for commercial, advertising, recompilation, repackaging, redistribution, reuse, obscuring or other similar activities.', format: 'string', group: 'contacts')
SettingEntry.create(code: 'legal_document_is_mandatory', value: 'true', format: 'boolean', group: 'domain_validation') SettingEntry.create(code: 'legal_document_is_mandatory', value: 'true', format: 'boolean', group: 'domain_validation')

View file

@ -1,349 +1,464 @@
registry_vat_prc: registry_vat_prc:
code: registry_vat_prc code: registry_vat_prc
value: '0.2' value: '0.2'
group: billing group: billing
format: float format: float
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
directo_sales_agent: directo_sales_agent:
code: directo_sales_agent code: directo_sales_agent
value: HELEN value: HELEN
group: billing group: billing
format: string format: string
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
admin_contacts_min_count: admin_contacts_min_count:
code: admin_contacts_min_count code: admin_contacts_min_count
value: '1' value: '1'
group: domain_validation group: domain_validation
format: integer format: integer
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
admin_contacts_max_count: admin_contacts_max_count:
code: admin_contacts_max_count code: admin_contacts_max_count
value: '10' value: '10'
group: domain_validation group: domain_validation
format: integer format: integer
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
tech_contacts_min_count: tech_contacts_min_count:
code: tech_contacts_min_count code: tech_contacts_min_count
value: '1' value: '1'
group: domain_validation group: domain_validation
format: integer format: integer
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
tech_contacts_max_count: tech_contacts_max_count:
code: tech_contacts_max_count code: tech_contacts_max_count
value: '10' value: '10'
group: domain_validation group: domain_validation
format: integer format: integer
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
orphans_contacts_in_months: orphans_contacts_in_months:
code: orphans_contacts_in_months code: orphans_contacts_in_months
value: '6' value: '6'
group: domain_validation group: domain_validation
format: integer format: integer
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
ds_data_allowed: ds_data_allowed:
code: ds_data_allowed code: ds_data_allowed
value: 'false' value: 'false'
group: domain_validation group: domain_validation
format: boolean format: boolean
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
key_data_allowed: key_data_allowed:
code: key_data_allowed code: key_data_allowed
value: 'true' value: 'true'
group: domain_validation group: domain_validation
format: boolean format: boolean
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
dnskeys_min_count: dnskeys_min_count:
code: dnskeys_min_count code: dnskeys_min_count
value: '0' value: '0'
group: domain_validation group: domain_validation
format: integer format: integer
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
dnskeys_max_count: dnskeys_max_count:
code: dnskeys_max_count code: dnskeys_max_count
value: '9' value: '9'
group: domain_validation group: domain_validation
format: integer format: integer
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
nameserver_required: nameserver_required:
code: nameserver_required code: nameserver_required
value: 'false' value: 'false'
group: domain_validation group: domain_validation
format: boolean format: boolean
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
ns_min_count: ns_min_count:
code: ns_min_count code: ns_min_count
value: '2' value: '2'
group: domain_validation group: domain_validation
format: integer format: integer
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
ns_max_count: ns_max_count:
code: ns_max_count code: ns_max_count
value: '11' value: '11'
group: domain_validation group: domain_validation
format: integer format: integer
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
expire_pending_confirmation: expire_pending_confirmation:
code: expire_pending_confirmation code: expire_pending_confirmation
value: '48' value: '48'
group: domain_validation group: domain_validation
format: integer format: integer
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
days_to_renew_domain_before_expire: days_to_renew_domain_before_expire:
code: days_to_renew_domain_before_expire code: days_to_renew_domain_before_expire
value: '90' value: '90'
group: domain_expiration group: domain_expiration
format: integer format: integer
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
expire_warning_period: expire_warning_period:
code: expire_warning_period code: expire_warning_period
value: '15' value: '15'
group: domain_expiration group: domain_expiration
format: integer format: integer
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
redemption_grace_period: redemption_grace_period:
code: redemption_grace_period code: redemption_grace_period
value: '30' value: '30'
group: domain_expiration group: domain_expiration
format: integer format: integer
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
transfer_wait_time: transfer_wait_time:
code: transfer_wait_time code: transfer_wait_time
value: '0' value: '0'
group: other group: other
format: integer format: integer
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
ds_digest_type: ds_digest_type:
code: ds_digest_type code: ds_digest_type
value: '2' value: '2'
group: other group: other
format: integer format: integer
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
client_side_status_editing_enabled: client_side_status_editing_enabled:
code: client_side_status_editing_enabled code: client_side_status_editing_enabled
value: 'false' value: 'false'
group: other group: other
format: boolean format: boolean
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
api_ip_whitelist_enabled: api_ip_whitelist_enabled:
code: api_ip_whitelist_enabled code: api_ip_whitelist_enabled
value: 'false' value: 'false'
group: other group: other
format: boolean format: boolean
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
registrar_ip_whitelist_enabled: registrar_ip_whitelist_enabled:
code: registrar_ip_whitelist_enabled code: registrar_ip_whitelist_enabled
value: 'false' value: 'false'
group: other group: other
format: boolean format: boolean
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
request_confrimation_on_registrant_change_enabled: request_confrimation_on_registrant_change_enabled:
code: request_confrimation_on_registrant_change_enabled code: request_confrimation_on_registrant_change_enabled
value: 'true' value: 'true'
group: other group: other
format: boolean format: boolean
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
request_confirmation_on_domain_deletion_enabled: request_confirmation_on_domain_deletion_enabled:
code: request_confirmation_on_domain_deletion_enabled code: request_confirmation_on_domain_deletion_enabled
value: 'true' value: 'true'
group: other group: other
format: boolean format: boolean
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
default_language: default_language:
code: default_language code: default_language
value: en value: en
group: other group: other
format: string format: string
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
invoice_number_min: invoice_number_min:
code: invoice_number_min code: invoice_number_min
value: '131050' value: '131050'
group: billing group: billing
format: integer format: integer
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
invoice_number_max: invoice_number_max:
code: invoice_number_max code: invoice_number_max
value: '149999' value: '149999'
group: billing group: billing
format: integer format: integer
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
days_to_keep_invoices_active: days_to_keep_invoices_active:
code: days_to_keep_invoices_active code: days_to_keep_invoices_active
value: '30' value: '30'
group: billing group: billing
format: integer format: integer
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
days_to_keep_overdue_invoices_active: days_to_keep_overdue_invoices_active:
code: days_to_keep_overdue_invoices_active code: days_to_keep_overdue_invoices_active
value: '0' value: '0'
group: billing group: billing
format: integer format: integer
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
minimum_deposit: minimum_deposit:
code: minimum_deposit code: minimum_deposit
value: '0.0' value: '0.0'
group: billing group: billing
format: float format: float
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
directo_receipt_payment_term: directo_receipt_payment_term:
code: directo_receipt_payment_term code: directo_receipt_payment_term
value: R value: R
group: billing group: billing
format: string format: string
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
directo_receipt_product_name: directo_receipt_product_name:
code: directo_receipt_product_name code: directo_receipt_product_name
value: ETTEM06 value: ETTEM06
group: billing group: billing
format: string format: string
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
registry_billing_email: registry_billing_email:
code: registry_billing_email code: registry_billing_email
value: info@internet.ee value: info@internet.ee
group: billing group: billing
format: string format: string
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
registry_invoice_contact: registry_invoice_contact:
code: registry_invoice_contact code: registry_invoice_contact
value: Martti Õigus value: 'Martti Õigus'
group: billing group: billing
format: string format: string
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
registry_vat_no: registry_vat_no:
code: registry_vat_no code: registry_vat_no
value: EE101286464 value: EE101286464
group: billing group: billing
format: string format: string
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
registry_bank: registry_bank:
code: registry_bank code: registry_bank
value: LHV Pank value: 'LHV Pank'
group: billing group: billing
format: string format: string
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
registry_iban: registry_iban:
code: registry_iban code: registry_iban
value: EE557700771000598731 value: EE557700771000598731
group: billing group: billing
format: string format: string
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
registry_swift: registry_swift:
code: registry_swift code: registry_swift
value: LHVBEE22 value: LHVBEE22
group: billing group: billing
format: string format: string
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
registry_email: registry_email:
code: registry_email code: registry_email
value: info@internet.ee value: info@internet.ee
group: contacts group: contacts
format: string format: string
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
registry_phone: registry_phone:
code: registry_phone code: registry_phone
value: "+372 727 1000" value: '+372 727 1000'
group: contacts group: contacts
format: string format: string
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
registry_url: registry_url:
code: registry_url code: registry_url
value: www.internet.ee value: www.internet.ee
group: contacts group: contacts
format: string format: string
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
registry_street: registry_street:
code: registry_street code: registry_street
value: Paldiski mnt 80 value: 'Paldiski mnt 80'
group: contacts group: contacts
format: string format: string
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
registry_city: registry_city:
code: registry_city code: registry_city
value: Tallinn value: Tallinn
group: contacts group: contacts
format: string format: string
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
registry_state: registry_state:
code: registry_state code: registry_state
value: Harjumaa value: Harjumaa
group: contacts group: contacts
format: string format: string
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
registry_country_code: registry_country_code:
code: registry_country_code code: registry_country_code
value: EE value: US
group: contacts group: contacts
format: string format: string
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
expiration_reminder_mail: expiration_reminder_mail:
code: expiration_reminder_mail code: expiration_reminder_mail
value: '2' value: '2'
group: domain_expiration group: domain_expiration
format: integer format: integer
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
directo_monthly_number_min: directo_monthly_number_min:
code: directo_monthly_number_min code: directo_monthly_number_min
value: '309901' value: '309901'
group: billing group: billing
format: integer format: integer
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
directo_monthly_number_max: directo_monthly_number_max:
code: directo_monthly_number_max code: directo_monthly_number_max
value: '309999' value: '309999'
group: billing group: billing
format: integer format: integer
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
registry_bank_code: registry_bank_code:
code: registry_bank_code code: registry_bank_code
value: '689' value: '689'
group: billing group: billing
format: string format: string
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
registry_reg_no: registry_reg_no:
code: registry_reg_no code: registry_reg_no
value: '90010019' value: '90010019'
group: contacts group: contacts
format: string format: string
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
registry_zip: registry_zip:
code: registry_zip code: registry_zip
value: '10617' value: '10617'
group: contacts group: contacts
format: string format: string
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
registry_juridical_name: registry_juridical_name:
code: registry_juridical_name code: registry_juridical_name
value: Eesti Interneti SA value: 'Eesti Interneti SA'
group: contacts group: contacts
format: string format: string
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
address_processing: address_processing:
code: address_processing code: address_processing
value: 'true' value: 'false'
group: other group: other
format: boolean format: boolean
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
directo_monthly_number_last: directo_monthly_number_last:
code: directo_monthly_number_last code: directo_monthly_number_last
value: '309909' value: '309901'
group: billing group: billing
format: integer format: integer
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
dispute_period_in_months: dispute_period_in_months:
code: dispute_period_in_months code: dispute_period_in_months
value: '36' value: '36'
group: other group: other
format: integer format: integer
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
registry_whois_disclaimer: registry_whois_disclaimer:
code: registry_whois_disclaimer code: registry_whois_disclaimer
value: Search results may not be used for commercial, advertising, recompilation, value: 'Search results may not be used for commercial, advertising, recompilation,
repackaging, redistribution, reuse, obscuring or other similar activities. repackaging, redistribution, reuse, obscuring or other similar activities.'
group: contacts group: contacts
format: string format: string
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>
legal_document_is_mandatory: legal_document_is_mandatory:
code: legal_document_is_mandatory code: legal_document_is_mandatory
value: 'true' value: 'true'
group: domain_validation group: domain_validation
format: boolean format: boolean
created_at: <%= Time.zone.parse('2010-07-05') %>
updated_at: <%= Time.zone.parse('2010-07-05') %>

View file

@ -0,0 +1,10 @@
require 'test_helper'
class SettingEntryTest < ActiveSupport::TestCase
def setup
end
def test_fixture_is_valid
assert setting_entries(:legal_document_is_mandatory).valid?
end
end

View file

@ -26,9 +26,6 @@ require 'rake'
Rake::Task.clear Rake::Task.clear
Rails.application.load_tasks Rails.application.load_tasks
Setting.address_processing = false
Setting.registry_country_code = 'US'
class CompanyRegisterClientStub class CompanyRegisterClientStub
Company = Struct.new(:registration_number) Company = Struct.new(:registration_number)