mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 03:06:14 +02:00
Complete auction integration
This commit is contained in:
parent
f1148bd4f4
commit
446b9fbf77
6 changed files with 62 additions and 6 deletions
|
@ -15,7 +15,8 @@ class AuctionTest < ActiveSupport::TestCase
|
|||
'awaiting_payment' => 'awaiting_payment',
|
||||
'payment_received' => 'payment_received',
|
||||
'payment_not_received' => 'payment_not_received',
|
||||
'domain_registered' => 'domain_registered' }), Auction.statuses
|
||||
'domain_registered' => 'domain_registered',
|
||||
'domain_not_registered' => 'domain_not_registered' }), Auction.statuses
|
||||
end
|
||||
|
||||
def test_selling_domain_starts_new_auction
|
||||
|
@ -95,6 +96,27 @@ class AuctionTest < ActiveSupport::TestCase
|
|||
assert new_auction.started?
|
||||
end
|
||||
|
||||
def test_marking_as_domain_not_registered
|
||||
@auction.update!(status: Auction.statuses[:payment_received])
|
||||
|
||||
@auction.mark_as_domain_not_registered
|
||||
@auction.reload
|
||||
|
||||
assert @auction.domain_not_registered?
|
||||
end
|
||||
|
||||
def test_restarts_an_auction_when_domain_is_not_registered
|
||||
@auction.update!(domain: 'auction.test', status: Auction.statuses[:domain_not_registered])
|
||||
|
||||
assert_difference 'Auction.count' do
|
||||
@auction.mark_as_domain_not_registered
|
||||
end
|
||||
|
||||
new_auction = Auction.last
|
||||
assert_equal 'auction.test', new_auction.domain
|
||||
assert new_auction.started?
|
||||
end
|
||||
|
||||
def test_domain_registrable
|
||||
assert @auction.no_bids?
|
||||
assert_not @auction.domain_registrable?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue