Fix WHOIS update for a domain being sent to an auction

This commit is contained in:
Artur Beljajev 2019-03-08 12:38:49 +02:00
parent 85ba5c066a
commit 98c415f672
3 changed files with 18 additions and 3 deletions

View file

@ -1,6 +1,9 @@
require 'test_helper'
class DomainReleasableAuctionableTest < ActiveSupport::TestCase
# Needed for `test_updates_whois` test because of `after_commit :update_whois_record` in Domain
self.use_transactional_fixtures = false
setup do
@domain = domains(:shop)
Domain.release_to_auction = true
@ -28,6 +31,16 @@ class DomainReleasableAuctionableTest < ActiveSupport::TestCase
end
end
def test_updates_whois
assert_equal 'shop.test', @domain.name
@domain.update!(delete_at: Time.zone.parse('2010-07-05 07:59'))
travel_to Time.zone.parse('2010-07-05 08:00')
Domain.release_domains
assert Whois::Record.find_by(name: 'shop.test')
end
def test_ignores_domains_with_delete_at_in_the_future_or_now
@domain.update!(delete_at: Time.zone.parse('2010-07-05 08:00'))
travel_to Time.zone.parse('2010-07-05 08:00')