mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 11:16:00 +02:00
Fix whois #2623
This commit is contained in:
parent
12a05c524c
commit
777f3836e7
3 changed files with 16 additions and 12 deletions
|
@ -20,11 +20,11 @@ class WhoisRecord < ActiveRecord::Base
|
|||
includes(
|
||||
domain: [
|
||||
:registrant,
|
||||
:registrar,
|
||||
:nameservers,
|
||||
:registrar,
|
||||
:nameservers,
|
||||
{ tech_contacts: :registrar },
|
||||
{ admin_contacts: :registrar }
|
||||
]
|
||||
]
|
||||
)
|
||||
end
|
||||
end
|
||||
|
@ -34,19 +34,23 @@ class WhoisRecord < ActiveRecord::Base
|
|||
h = HashWithIndifferentAccess.new
|
||||
return h if domain.blank?
|
||||
|
||||
status_map = {
|
||||
'ok' => 'ok (paid and in zone)'
|
||||
}
|
||||
|
||||
@disclosed = []
|
||||
h[:name] = domain.name
|
||||
h[:registrant] = domain.registrant.name
|
||||
h[:status] = domain.domain_statuses.map(&:human_value).join(', ')
|
||||
h[:status] = domain.statuses.map { |x| status_map[x] || x }.join(', ')
|
||||
h[:registered] = domain.registered_at.try(:to_s, :iso8601)
|
||||
h[:updated_at] = domain.updated_at.try(:to_s, :iso8601)
|
||||
h[:valid_to] = domain.valid_to.try(:to_s, :iso8601)
|
||||
|
||||
|
||||
# update registar triggers when adding new attributes
|
||||
h[:registrar] = domain.registrar.name
|
||||
h[:registrar_phone] = domain.registrar.phone
|
||||
h[:registrar_address] = domain.registrar.address
|
||||
h[:registrar_update_at] = domain.registrar.updated_at.try(:to_s, :iso8601)
|
||||
h[:registrar_update_at] = domain.registrar.updated_at.try(:to_s, :iso8601)
|
||||
|
||||
h[:admin_contacts] = []
|
||||
domain.admin_contacts.each do |ac|
|
||||
|
|
|
@ -22,11 +22,11 @@ feature 'DomainDeleteConfirm', type: :feature do
|
|||
context 'as unknown user with domain with token' do
|
||||
before :all do
|
||||
@domain = Fabricate(
|
||||
:domain,
|
||||
registrant_verification_token: '123',
|
||||
:domain,
|
||||
registrant_verification_token: '123',
|
||||
registrant_verification_asked_at: Time.zone.now
|
||||
)
|
||||
@domain.domain_statuses.create(value: DomainStatus::PENDING_DELETE)
|
||||
@domain.statuses << DomainStatus::PENDING_DELETE
|
||||
end
|
||||
|
||||
it 'should see warning info if token is missing in request' do
|
||||
|
|
|
@ -22,11 +22,11 @@ feature 'DomainUpdateConfirm', type: :feature do
|
|||
context 'as unknown user with domain with update token' do
|
||||
before :all do
|
||||
@domain = Fabricate(
|
||||
:domain,
|
||||
registrant_verification_token: '123',
|
||||
:domain,
|
||||
registrant_verification_token: '123',
|
||||
registrant_verification_asked_at: Time.zone.now
|
||||
)
|
||||
@domain.domain_statuses.create(value: DomainStatus::PENDING_UPDATE)
|
||||
@domain.statuses << DomainStatus::PENDING_UPDATE
|
||||
end
|
||||
|
||||
it 'should see warning info if token is missing in request' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue