From 1b0c264f547209c59789bf27f9c1ba05ddd36ae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Mon, 3 Aug 2020 13:38:35 +0300 Subject: [PATCH] Add tests for domain delete confirm UI --- .../domains/domain_delete_confirms_test.rb | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 test/system/registrant_area/domains/domain_delete_confirms_test.rb diff --git a/test/system/registrant_area/domains/domain_delete_confirms_test.rb b/test/system/registrant_area/domains/domain_delete_confirms_test.rb new file mode 100644 index 000000000..fac381dc4 --- /dev/null +++ b/test/system/registrant_area/domains/domain_delete_confirms_test.rb @@ -0,0 +1,32 @@ +require 'application_system_test_case' + +class DomainDeleteConfirmsTest < ApplicationSystemTestCase + setup do + @user = users(:registrant) + sign_in @user + + @domain = domains(:shop) + @domain.registrant_verification_asked!('\n', @user.id) + @domain.pending_delete! + end + + def test_enqueues_approve_job_after_verification + visit registrant_domain_delete_confirm_url(@domain.id, token: @domain.registrant_verification_token) + + click_on 'Confirm domain delete' + assert_text 'Domain registrant change has successfully received.' + + @domain.reload + assert_includes @domain.statuses, 'serverHold' + end + + def test_enqueues_reject_job_after_verification + visit registrant_domain_delete_confirm_url(@domain.id, token: @domain.registrant_verification_token) + + click_on 'Reject domain delete' + assert_text 'Domain registrant change has been rejected successfully.' + + @domain.reload + assert_equal ['ok'], @domain.statuses + end +end