mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 22:54:47 +02:00
Add tests
This commit is contained in:
parent
8ca320244b
commit
77b9d02b5d
2 changed files with 27 additions and 0 deletions
|
@ -592,6 +592,8 @@ class Domain < ApplicationRecord
|
|||
def admin_status_update(update)
|
||||
update_unless_locked_by_registrant(update)
|
||||
update_not_by_locked_statuses(update)
|
||||
return unless update
|
||||
|
||||
# check for deleted status
|
||||
statuses.each do |s|
|
||||
unless update.include? s
|
||||
|
|
|
@ -21,6 +21,31 @@ class AdminAreaDomainForceDeleteTest < ApplicationSystemTestCase
|
|||
assert_text 'Force delete procedure has been scheduled'
|
||||
end
|
||||
|
||||
def test_schedules_domain_force_delete_two
|
||||
refute @domain.force_delete_scheduled?
|
||||
|
||||
visit edit_admin_domain_url(@domain)
|
||||
click_link_or_button 'Force delete domain'
|
||||
@domain.reload
|
||||
|
||||
assert @domain.force_delete_scheduled?
|
||||
assert_current_path edit_admin_domain_path(@domain)
|
||||
assert_text 'Force delete procedure has been scheduled'
|
||||
|
||||
click_link_or_button 'Add new status'
|
||||
last_input = page.all(:id, 'domain_statuses_').last
|
||||
last_input.find(:xpath, 'option[10]').select_option
|
||||
click_link_or_button 'Save'
|
||||
assert_text 'Failed to update domain'
|
||||
|
||||
click_link_or_button 'Cancel force delete'
|
||||
@domain.reload
|
||||
|
||||
refute @domain.force_delete_scheduled?
|
||||
assert_current_path edit_admin_domain_path(@domain)
|
||||
assert_text 'Force delete procedure has been cancelled'
|
||||
end
|
||||
|
||||
def test_notifies_registrar
|
||||
assert_difference '@domain.registrar.notifications.size' do
|
||||
visit edit_admin_domain_url(@domain)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue