mirror of
https://github.com/internetee/registry.git
synced 2025-08-01 23:42:04 +02:00
Merge branch 'master' into 952-revoking-cert-does-not-stop-user-from-logging-in
This commit is contained in:
commit
04b10ab0be
8 changed files with 51 additions and 9 deletions
|
@ -39,6 +39,17 @@ class ApiV1AuctionUpdateTest < ActionDispatch::IntegrationTest
|
|||
assert @auction.awaiting_payment?
|
||||
end
|
||||
|
||||
def test_sets_registration_deadline
|
||||
deadline = (Time.zone.now + 10.days).end_of_day
|
||||
patch api_v1_auction_path(@auction.uuid),
|
||||
params: { status: Auction.statuses[:awaiting_payment],
|
||||
registration_deadline: deadline},
|
||||
as: :json
|
||||
@auction.reload
|
||||
|
||||
assert_in_delta @auction.registration_deadline, deadline, 1.second
|
||||
end
|
||||
|
||||
def test_marks_as_no_bids
|
||||
patch api_v1_auction_path(@auction.uuid),
|
||||
params: { status: Auction.statuses[:no_bids] },
|
||||
|
|
|
@ -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