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:
Artur Beljajev 2018-08-09 15:01:23 +03:00
commit 1d79f6548d
61 changed files with 731 additions and 84 deletions

View 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

View 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