mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 05:34:46 +02:00
Make sure that only admin contacts and registrants can lock a domain
This commit is contained in:
parent
1d53e7bb5b
commit
a64b03d204
4 changed files with 49 additions and 14 deletions
|
@ -4,20 +4,27 @@ class RegistrantUserTest < ActiveSupport::TestCase
|
|||
def setup
|
||||
super
|
||||
|
||||
@user = RegistrantUser.new(registrant_ident: 'US-1234')
|
||||
@user = users(:registrant)
|
||||
end
|
||||
|
||||
def teardown
|
||||
super
|
||||
end
|
||||
|
||||
def test_domains_returns_an_list_of_domains_associated_with_a_specific_id_code
|
||||
def test_domains_returns_an_list_of_distinct_domains_associated_with_a_specific_id_code
|
||||
domain_names = @user.domains.pluck(:name)
|
||||
assert_equal(3, domain_names.length)
|
||||
|
||||
# User is a registrant, but not a contact for the domain.
|
||||
refute(domain_names.include?('shop.test'))
|
||||
end
|
||||
|
||||
def test_administrated_domains_returns_a_list_of_domains_that_is_smaller_than_domains
|
||||
assert_equal(2, @user.administrated_domains.count)
|
||||
def test_administrated_domains_returns_a_list_of_domains
|
||||
domain_names = @user.administrated_domains.pluck(:name)
|
||||
assert_equal(3, domain_names.length)
|
||||
|
||||
# User is a tech contact for the domain.
|
||||
refute(domain_names.include?('library.test'))
|
||||
end
|
||||
|
||||
def test_contacts_returns_an_list_of_contacts_associated_with_a_specific_id_code
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue