mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 22:54:47 +02:00
Add ability for admin to remove registry lock
This commit is contained in:
parent
4743b1e2a5
commit
dffe865d89
10 changed files with 174 additions and 29 deletions
55
test/system/admin_area/domains/registry_lock_test.rb
Normal file
55
test/system/admin_area/domains/registry_lock_test.rb
Normal file
|
@ -0,0 +1,55 @@
|
|||
require 'test_helper'
|
||||
|
||||
class RegistryLockTest < 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)
|
||||
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 registry lock that was set by registrant?') 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 registry lock that was set by registrant?') do
|
||||
click_link_or_button('Remove registry lock')
|
||||
end
|
||||
|
||||
assert_text('Registry lock could not be removed')
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue