mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 09:21:43 +02:00
Update whois record with auction registration_deadline if any
This commit is contained in:
parent
c6fd78b4cd
commit
5c419ae8be
4 changed files with 29 additions and 7 deletions
|
@ -40,24 +40,34 @@ class Whois::RecordTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
def test_updates_whois_record_from_auction_when_awaiting_payment
|
||||
@auction.update!(domain: 'domain.test', status: Auction.statuses[:awaiting_payment])
|
||||
@auction.update!(domain: 'domain.test',
|
||||
status: Auction.statuses[:awaiting_payment],
|
||||
registration_deadline: registration_deadline)
|
||||
@whois_record.update!(name: 'domain.test')
|
||||
@whois_record.update_from_auction(@auction)
|
||||
@whois_record.reload
|
||||
|
||||
assert_equal ({ 'name' => 'domain.test',
|
||||
'status' => ['PendingRegistration'],
|
||||
'disclaimer' => 'disclaimer' }), @whois_record.json
|
||||
'disclaimer' => 'disclaimer',
|
||||
'registration_deadline' => registration_deadline.to_s }), @whois_record.json
|
||||
end
|
||||
|
||||
def test_updates_whois_record_from_auction_when_payment_received
|
||||
@auction.update!(domain: 'domain.test', status: Auction.statuses[:payment_received])
|
||||
@auction.update!(domain: 'domain.test',
|
||||
status: Auction.statuses[:payment_received],
|
||||
registration_deadline: registration_deadline)
|
||||
@whois_record.update!(name: 'domain.test')
|
||||
@whois_record.update_from_auction(@auction)
|
||||
@whois_record.reload
|
||||
|
||||
assert_equal ({ 'name' => 'domain.test',
|
||||
'status' => ['PendingRegistration'],
|
||||
'disclaimer' => 'disclaimer' }), @whois_record.json
|
||||
'disclaimer' => 'disclaimer',
|
||||
'registration_deadline' => registration_deadline.to_s }), @whois_record.json
|
||||
end
|
||||
end
|
||||
|
||||
def registration_deadline
|
||||
Time.zone.now + 10.days
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue