mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 05:34:46 +02:00
Merge pull request #1102 from internetee/fix-auction-integration
Fix WHOIS generation for domains at auction
This commit is contained in:
commit
d86ec026e3
2 changed files with 9 additions and 5 deletions
|
@ -8,12 +8,16 @@ module Whois
|
|||
|
||||
def self.refresh(domain_name)
|
||||
if domain_name.at_auction?
|
||||
# Remove original record since `Domain#update_whois_record` callback is disabled when
|
||||
# domain is at auction
|
||||
find_by(name: domain_name.to_s).try(:destroy!)
|
||||
|
||||
create!(name: domain_name, json: { name: domain_name.to_s,
|
||||
status: 'AtAuction',
|
||||
status: ['AtAuction'],
|
||||
disclaimer: disclaimer })
|
||||
elsif domain_name.awaiting_payment? || domain_name.pending_registration?
|
||||
find_by(name: domain_name.to_s).update!(json: { name: domain_name.to_s,
|
||||
status: 'PendingRegistration',
|
||||
status: ['PendingRegistration'],
|
||||
disclaimer: disclaimer })
|
||||
else
|
||||
find_by(name: domain_name.to_s).destroy!
|
||||
|
|
|
@ -29,7 +29,7 @@ class Whois::RecordTest < ActiveSupport::TestCase
|
|||
whois_record = Whois::Record.last
|
||||
assert_equal 'some.test', whois_record.name
|
||||
assert_equal ({ 'name' => 'some.test',
|
||||
'status' => 'AtAuction',
|
||||
'status' => ['AtAuction'],
|
||||
'disclaimer' => 'disclaimer' }), whois_record.json
|
||||
end
|
||||
|
||||
|
@ -45,7 +45,7 @@ class Whois::RecordTest < ActiveSupport::TestCase
|
|||
whois_record = Whois::Record.find_by(name: 'some.test')
|
||||
assert_equal 'some.test', whois_record.name
|
||||
assert_equal ({ 'name' => 'some.test',
|
||||
'status' => 'PendingRegistration',
|
||||
'status' => ['PendingRegistration'],
|
||||
'disclaimer' => 'disclaimer' }), whois_record.json
|
||||
end
|
||||
|
||||
|
@ -61,7 +61,7 @@ class Whois::RecordTest < ActiveSupport::TestCase
|
|||
whois_record = Whois::Record.find_by(name: 'some.test')
|
||||
assert_equal 'some.test', whois_record.name
|
||||
assert_equal ({ 'name' => 'some.test',
|
||||
'status' => 'PendingRegistration',
|
||||
'status' => ['PendingRegistration'],
|
||||
'disclaimer' => 'disclaimer' }), whois_record.json
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue