Merge pull request #1638 from internetee/test-registrant-confirmations

Verify registrant change confirmation actions complete as expected
This commit is contained in:
Timo Võhmar 2020-08-04 14:37:43 +03:00 committed by GitHub
commit 6bde39f3de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 122 additions and 12 deletions

View file

@ -24,9 +24,9 @@ class Registrant::DomainDeleteConfirmsController < RegistrantController
confirmed = params[:confirmed] ? true : false
action = if confirmed
@registrant_verification.domain_registrant_delete_reject!("email link #{initiator}")
else
@registrant_verification.domain_registrant_delete_confirm!("email link #{initiator}")
else
@registrant_verification.domain_registrant_delete_reject!("email link #{initiator}")
end
fail_msg = t("registrant_domain_delete_#{confirmed ? 'confirmed' : 'rejected'}_failed".to_sym)
@ -36,9 +36,9 @@ class Registrant::DomainDeleteConfirmsController < RegistrantController
(render 'show' && return) unless action
if confirmed
redirect_to registrant_domain_delete_confirm_path(@domain.id, confirmed: true) && return
redirect_to registrant_domain_delete_confirm_path(@domain.id, confirmed: true)
else
redirect_to registrant_domain_delete_confirm_path(@domain.id, rejected: true) unless confirmed
redirect_to registrant_domain_delete_confirm_path(@domain.id, rejected: true)
end
end
end