mirror of
https://github.com/internetee/registry.git
synced 2025-07-25 12:08:27 +02:00
Merge branch 'master' into registry-790
# Conflicts: # test/integration/epp/domain/domain_delete_test.rb # test/integration/epp/domain/domain_update_test.rb # test/integration/epp/domain/transfer/request_test.rb # test/system/admin_area/domains_test.rb
This commit is contained in:
commit
1d79f6548d
61 changed files with 731 additions and 84 deletions
21
test/system/admin_area/domains/details_test.rb
Normal file
21
test/system/admin_area/domains/details_test.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
require 'test_helper'
|
||||
|
||||
class AdminAreaDomainDetailsTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
sign_in users(:admin)
|
||||
@domain = domains(:shop)
|
||||
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
|
||||
end
|
58
test/system/admin_area/domains/force_delete_test.rb
Normal file
58
test/system/admin_area/domains/force_delete_test.rb
Normal file
|
@ -0,0 +1,58 @@
|
|||
require 'test_helper'
|
||||
|
||||
class AdminAreaDomainForceDeleteTest < ApplicationSystemTestCase
|
||||
include ActionMailer::TestHelper
|
||||
|
||||
setup do
|
||||
sign_in users(:admin)
|
||||
@domain = domains(:shop)
|
||||
ActionMailer::Base.deliveries.clear
|
||||
end
|
||||
|
||||
def test_schedules_domain_force_delete
|
||||
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'
|
||||
end
|
||||
|
||||
def test_notifies_registrar
|
||||
assert_difference '@domain.registrar.messages.size' do
|
||||
visit edit_admin_domain_url(@domain)
|
||||
click_link_or_button 'Force delete domain'
|
||||
end
|
||||
end
|
||||
|
||||
def test_notifies_registrant_and_admin_contacts_by_email_by_default
|
||||
assert_emails 1 do
|
||||
visit edit_admin_domain_url(@domain)
|
||||
click_link_or_button 'Force delete domain'
|
||||
end
|
||||
end
|
||||
|
||||
def test_allows_to_skip_notifying_registrant_and_admin_contacts_by_email
|
||||
assert_no_emails do
|
||||
visit edit_admin_domain_url(@domain)
|
||||
uncheck 'notify_by_email'
|
||||
click_link_or_button 'Force delete domain'
|
||||
end
|
||||
end
|
||||
|
||||
def test_cancels_scheduled_domain_force_delete
|
||||
@domain.discard
|
||||
@domain.schedule_force_delete
|
||||
|
||||
visit edit_admin_domain_url(@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
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue