mirror of
https://github.com/internetee/registry.git
synced 2025-07-27 21:16:12 +02:00
added tests
This commit is contained in:
parent
31b5abd87e
commit
5f488119d0
1 changed files with 26 additions and 0 deletions
|
@ -142,4 +142,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
|
Loading…
Add table
Add a link
Reference in a new issue