mirror of
https://github.com/internetee/registry.git
synced 2025-07-30 14:36:22 +02:00
Merge branch 'master' into enable-trimming-dnskey
This commit is contained in:
commit
ae738aa11e
70 changed files with 1089 additions and 464 deletions
|
@ -131,6 +131,49 @@ class AuctionTest < ActiveSupport::TestCase
|
|||
assert_not @auction.domain_registrable?('')
|
||||
end
|
||||
|
||||
def test_restart_new_auction_should_with_previous_manual_platform
|
||||
@auction.update(platform: 'manual')
|
||||
@auction.reload
|
||||
|
||||
assert_equal @auction.platform, 'manual'
|
||||
|
||||
assert_difference 'Auction.count' do
|
||||
@auction.restart
|
||||
end
|
||||
|
||||
new_auction = Auction.last
|
||||
assert_equal new_auction.platform, 'manual'
|
||||
end
|
||||
|
||||
def test_restart_new_auction_should_with_previous_auto_platform
|
||||
@auction.update(platform: 'auto')
|
||||
@auction.reload
|
||||
|
||||
assert_equal @auction.platform, 'auto'
|
||||
|
||||
assert_difference 'Auction.count' do
|
||||
@auction.restart
|
||||
end
|
||||
|
||||
new_auction = Auction.last
|
||||
assert_equal new_auction.platform, 'auto'
|
||||
end
|
||||
|
||||
def test_restart_new_auction_should_with_auto_if_platform_is_nil
|
||||
@auction.update(platform: nil)
|
||||
@auction.reload
|
||||
|
||||
assert_nil @auction.platform
|
||||
|
||||
assert_difference 'Auction.count' do
|
||||
@auction.restart
|
||||
end
|
||||
|
||||
new_auction = Auction.last
|
||||
assert_equal new_auction.platform, 'auto'
|
||||
end
|
||||
|
||||
|
||||
def test_restarts_an_auction
|
||||
assert_equal 'auction.test', @auction.domain
|
||||
|
||||
|
@ -142,4 +185,30 @@ class AuctionTest < ActiveSupport::TestCase
|
|||
assert_equal 'auction.test', new_auction.domain
|
||||
assert new_auction.started?
|
||||
end
|
||||
|
||||
def test_auction_restart_should_assign_the_previous_manual_platform
|
||||
assert_equal 'auction.test', @auction.domain
|
||||
@auction.update(platform: :manual)
|
||||
@auction.reload
|
||||
|
||||
assert_difference 'Auction.count' do
|
||||
@auction.restart
|
||||
end
|
||||
|
||||
auctions = Auction.where(domain: @auction.domain)
|
||||
assert_equal auctions.first.platform, auctions.last.platform
|
||||
end
|
||||
|
||||
def test_auction_restart_should_assign_the_previous_auto_platform
|
||||
assert_equal 'auction.test', @auction.domain
|
||||
@auction.update(platform: :auto)
|
||||
@auction.reload
|
||||
|
||||
assert_difference 'Auction.count' do
|
||||
@auction.restart
|
||||
end
|
||||
|
||||
auctions = Auction.where(domain: @auction.domain)
|
||||
assert_equal auctions.first.platform, auctions.last.platform
|
||||
end
|
||||
end
|
|
@ -37,8 +37,7 @@ class BankTransactionTest < ActiveSupport::TestCase
|
|||
|
||||
first_transaction = BankTransaction.new(sum: 10,
|
||||
description: 'Order nr 1 from registrar 1234567 second number 2345678')
|
||||
|
||||
first_transaction.create_activity(another_invoice.buyer, another_invoice)
|
||||
first_transaction.bind_invoice(another_invoice.number)
|
||||
|
||||
transaction = BankTransaction.new(sum: 10,
|
||||
description: 'Order nr 1 from registrar 1234567 second number 2345678')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue