mirror of
https://github.com/internetee/registry.git
synced 2025-08-14 05:29:29 +02:00
added email notification test
This commit is contained in:
parent
485de905db
commit
33b38e52c6
1 changed files with 7 additions and 2 deletions
|
@ -42,12 +42,17 @@ class AdminCertificatesControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
def test_sign_certificate
|
def test_sign_certificate
|
||||||
Certificate.stub_any_instance(:sign!, true) do
|
Certificate.stub_any_instance(:sign!, true) do
|
||||||
post sign_admin_api_user_certificate_path(api_user_id: @api_user.id, id: @certificate.id),
|
assert_difference -> { ActionMailer::Base.deliveries.size }, 1 do
|
||||||
params: { certificate: { password: @password } }
|
post sign_admin_api_user_certificate_path(api_user_id: @api_user.id, id: @certificate.id),
|
||||||
|
params: { certificate: { password: @password } }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_redirected_to admin_api_user_certificate_path(@api_user, @certificate)
|
assert_redirected_to admin_api_user_certificate_path(@api_user, @certificate)
|
||||||
assert_equal I18n.t('record_updated'), flash[:notice]
|
assert_equal I18n.t('record_updated'), flash[:notice]
|
||||||
|
|
||||||
|
mail = ActionMailer::Base.deliveries.last
|
||||||
|
assert_includes mail.to, @api_user.registrar.email
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_revoke_certificate
|
def test_revoke_certificate
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue