Merge pull request #5304 from tchak/remove-admin-creation-email
Remove admin creation notification email
This commit is contained in:
commit
d775537fe8
5 changed files with 0 additions and 26 deletions
|
@ -2,15 +2,6 @@
|
||||||
class AdministrationMailer < ApplicationMailer
|
class AdministrationMailer < ApplicationMailer
|
||||||
layout 'mailers/layout'
|
layout 'mailers/layout'
|
||||||
|
|
||||||
def new_admin_email(admin, administration)
|
|
||||||
@admin = admin
|
|
||||||
@administration = administration
|
|
||||||
subject = "Création d'un compte admininistrateur"
|
|
||||||
|
|
||||||
mail(to: TECH_EMAIL,
|
|
||||||
subject: subject)
|
|
||||||
end
|
|
||||||
|
|
||||||
def invite_admin(admin, reset_password_token, administration_id)
|
def invite_admin(admin, reset_password_token, administration_id)
|
||||||
@reset_password_token = reset_password_token
|
@reset_password_token = reset_password_token
|
||||||
@admin = admin
|
@admin = admin
|
||||||
|
|
|
@ -11,7 +11,6 @@ class Administration < ApplicationRecord
|
||||||
user = User.create_or_promote_to_administrateur(email, SecureRandom.hex)
|
user = User.create_or_promote_to_administrateur(email, SecureRandom.hex)
|
||||||
|
|
||||||
if user.valid?
|
if user.valid?
|
||||||
AdministrationMailer.new_admin_email(user.administrateur, self).deliver_later
|
|
||||||
user.invite_administrateur!(id)
|
user.invite_administrateur!(id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,6 @@ describe Manager::AdministrateursController, type: :controller do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'alert new mail are send' do
|
it 'alert new mail are send' do
|
||||||
expect(AdministrationMailer).to receive(:new_admin_email).and_return(AdministrationMailer)
|
|
||||||
expect(AdministrationMailer).to receive(:deliver_later)
|
|
||||||
expect(AdministrationMailer).to receive(:invite_admin).and_return(AdministrationMailer)
|
expect(AdministrationMailer).to receive(:invite_admin).and_return(AdministrationMailer)
|
||||||
expect(AdministrationMailer).to receive(:deliver_later)
|
expect(AdministrationMailer).to receive(:deliver_later)
|
||||||
subject
|
subject
|
||||||
|
|
|
@ -1,13 +1,4 @@
|
||||||
RSpec.describe AdministrationMailer, type: :mailer do
|
RSpec.describe AdministrationMailer, type: :mailer do
|
||||||
describe '#new_admin_email' do
|
|
||||||
let(:admin) { create(:administrateur) }
|
|
||||||
let(:administration) { create(:administration) }
|
|
||||||
|
|
||||||
subject { described_class.new_admin_email(admin, administration) }
|
|
||||||
|
|
||||||
it { expect(subject.subject).not_to be_empty }
|
|
||||||
end
|
|
||||||
|
|
||||||
describe '#invite_admin' do
|
describe '#invite_admin' do
|
||||||
let(:admin) { create(:administrateur) }
|
let(:admin) { create(:administrateur) }
|
||||||
let(:token) { "Toc toc toc" }
|
let(:token) { "Toc toc toc" }
|
||||||
|
|
|
@ -19,11 +19,6 @@ class AdministrationMailerPreview < ActionMailer::Preview
|
||||||
AdministrationMailer.refuse_admin('bad_admin@pipo.com')
|
AdministrationMailer.refuse_admin('bad_admin@pipo.com')
|
||||||
end
|
end
|
||||||
|
|
||||||
def new_admin
|
|
||||||
administration = Administration.new(email: 'superadmin@demarches-simplifiees.fr')
|
|
||||||
AdministrationMailer.new_admin_email(administrateur, administration)
|
|
||||||
end
|
|
||||||
|
|
||||||
def dossier_expiration_summary
|
def dossier_expiration_summary
|
||||||
expiring_dossiers = [Dossier.new(id: 100, procedure: procedure_1)]
|
expiring_dossiers = [Dossier.new(id: 100, procedure: procedure_1)]
|
||||||
expired_dossiers = [Dossier.new(id: 100, procedure: procedure_2)]
|
expired_dossiers = [Dossier.new(id: 100, procedure: procedure_2)]
|
||||||
|
|
Loading…
Reference in a new issue