Merge branch 'master' into improve-registrant-area

# Conflicts:
#	test/fixtures/contacts.yml
This commit is contained in:
Artur Beljajev 2018-09-01 19:37:44 +03:00
commit 3ca95364ef
51 changed files with 1021 additions and 235 deletions

View file

@ -21,8 +21,8 @@ class ContactVersionsTest < ApplicationSystemTestCase
VALUES (75, 'test_registrar', 'test123', 'test@test.com', 'EE', 'TEST123',
'test123', 'en');
INSERT INTO contacts (id, code, auth_info, registrar_id)
VALUES (75, 'test_code', '8b4d462aa04194ca78840a', 75);
INSERT INTO contacts (id, code, email, auth_info, registrar_id)
VALUES (75, 'test_code', 'test@inbox.test', '8b4d462aa04194ca78840a', 75);
INSERT INTO log_contacts (item_type, item_id, event, whodunnit, object,
object_changes, created_at, session, children, ident_updated_at, uuid)

View file

@ -21,8 +21,8 @@ class DomainVersionsTest < ApplicationSystemTestCase
VALUES (54, 'test_registrar', 'test123', 'test@test.com', 'EE', 'TEST123',
'test123', 'en');
INSERT INTO contacts (id, code, auth_info, registrar_id)
VALUES (54, 'test_code', '8b4d462aa04194ca78840a', 54);
INSERT INTO contacts (id, code, email, auth_info, registrar_id)
VALUES (54, 'test_code', 'test@inbox.test', '8b4d462aa04194ca78840a', 54);
INSERT INTO domains (id, registrar_id, valid_to, registrant_id,
transfer_code)

View file

@ -7,9 +7,14 @@ class AdminAreaDomainDetailsTest < ApplicationSystemTestCase
end
def test_discarded_domain_has_corresponding_label
travel_to Time.zone.parse('2010-07-05 10:30')
@domain.delete_at = Time.zone.parse('2010-07-05 10:00')
visit admin_domain_url(@domain)
assert_no_css 'span.label.label-warning', text: 'deleteCandidate'
@domain.discard
visit admin_domain_url(@domain)
assert_css 'span.label.label-warning', text: 'deleteCandidate'
end

View file

@ -56,7 +56,7 @@ class AdminAreaDomainForceDeleteTest < ApplicationSystemTestCase
end
def test_force_delete_procedure_cannot_be_scheduled_on_a_discarded_domain
@domain.discard
@domain.update!(statuses: [DomainStatus::DELETE_CANDIDATE])
visit edit_admin_domain_url(@domain)
assert_no_button 'Schedule force delete'

View file

@ -0,0 +1,57 @@
require 'test_helper'
class AdminAreaRegistryLockTest < JavaScriptApplicationSystemTestCase
def setup
super
WebMock.allow_net_connect!
sign_in users(:admin)
travel_to Time.zone.parse('2010-07-05 00:30:00')
@domain = domains(:airport)
end
def teardown
travel_back
end
def test_does_not_have_link_when_domain_is_not_locked
visit edit_admin_domain_path(@domain)
click_link_or_button('Actions')
refute(page.has_link?('Remove registry lock'))
end
def test_can_remove_registry_lock_from_a_domain
@domain.apply_registry_lock
visit edit_admin_domain_path(@domain)
click_link_or_button('Actions')
assert(page.has_link?('Remove registry lock'))
accept_confirm('Are you sure you want to remove the registry lock?') do
click_link_or_button('Remove registry lock')
end
assert_text('Registry lock removed')
@domain.reload
refute @domain.locked_by_registrant?
end
def test_cannot_remove_registry_lock_from_not_locked_domain
@domain.apply_registry_lock
visit edit_admin_domain_path(@domain)
@domain.remove_registry_lock
refute @domain.locked_by_registrant?
click_link_or_button('Actions')
assert(page.has_link?('Remove registry lock'))
accept_confirm('Are you sure you want to remove the registry lock?') do
click_link_or_button('Remove registry lock')
end
assert_text('Registry lock could not be removed')
refute @domain.locked_by_registrant?
end
end

View file

@ -3,11 +3,41 @@ require 'test_helper'
class AdminDomainsTestTest < ApplicationSystemTestCase
setup do
sign_in users(:admin)
travel_to Time.zone.parse('2010-07-05 00:30:00')
@domain = domains(:shop)
end
teardown do
travel_back
end
def test_shows_details
domain = domains(:shop)
visit admin_domain_path(domain)
assert_field nil, with: domain.transfer_code
visit admin_domain_path(@domain)
assert_field nil, with: @domain.transfer_code
end
def test_admin_registry_lock_date
visit admin_domain_path(@domain)
refute_text 'Registry lock time 2010-07-05 00:30'
lockable_domain = domains(:airport)
lockable_domain.apply_registry_lock
visit admin_domain_path(lockable_domain)
assert_text 'Registry lock time 2010-07-05 00:30'
assert_text 'registryLock'
end
def test_keep_a_domain
@domain.delete_at = Time.zone.parse('2010-07-05 10:00')
@domain.discard
visit edit_admin_domain_url(@domain)
click_link_or_button 'Remove deleteCandidate status'
@domain.reload
assert_not @domain.discarded?
assert_text 'deleteCandidate status has been removed'
assert_no_link 'Remove deleteCandidate status'
end
end