added tests for disputed and admin_user models

This commit is contained in:
Oleg Hasjanov 2021-02-18 13:46:01 +02:00
parent ad391e1b8c
commit 3877c11d4d
2 changed files with 23 additions and 0 deletions

View file

@ -123,6 +123,15 @@ class AdminUserTest < ActiveSupport::TestCase
assert user.valid?
end
def test_min_password_length
assert_equal AdminUser.min_password_length, 8
end
def test_country_instance
user = valid_user
assert user.country.present?
end
private
def valid_user

View file

@ -16,6 +16,20 @@ class DisputedDomainTest < ActiveSupport::TestCase
@dispute.reload
assert @dispute.closed
assert @dispute.forward_to_auction_if_possible
n = Whois::Record.find_by(name: @dispute.domain_name)
assert @dispute.remove_whois_data(n)
end
def test_invalid_auth
travel_to Time.zone.parse('2010-10-05')
assert_not Dispute.valid_auth?(nil, nil)
end
def test_valid_auth
travel_to Time.zone.parse('2010-10-05')
assert Dispute.valid_auth?(@dispute.domain_name, @dispute.password)
end
def test_syncs_password_to_reserved