Rename new_admin_mailer to administration_mailer

This commit is contained in:
simon lehericey 2018-01-03 17:11:47 +01:00 committed by Simon Lehericey
parent c4d0028d6d
commit d7d5d7eff4
4 changed files with 4 additions and 4 deletions

View file

@ -18,7 +18,7 @@ class AdministrationsController < ApplicationController
if admin.save
flash.notice = "Administrateur créé"
NewAdminMailer.new_admin_email(admin, current_administration).deliver_now!
AdministrationMailer.new_admin_email(admin, current_administration).deliver_now!
else
flash.alert = admin.errors.full_messages
end

View file

@ -1,4 +1,4 @@
class NewAdminMailer < ApplicationMailer
class AdministrationMailer < ApplicationMailer
def new_admin_email admin, administration
@admin = admin
@administration = administration

View file

@ -35,8 +35,8 @@ describe AdministrationsController, type: :controller do
end
it 'alert new mail are send' do
expect(NewAdminMailer).to receive(:new_admin_email).and_return(NewAdminMailer)
expect(NewAdminMailer).to receive(:deliver_now!)
expect(AdministrationMailer).to receive(:new_admin_email).and_return(AdministrationMailer)
expect(AdministrationMailer).to receive(:deliver_now!)
subject
end
end