From 7fed476e291fa28e567110361ce9ab5b4109e7e8 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Tue, 22 May 2018 17:23:32 +0200 Subject: [PATCH] Welcome Mailer: remove obsolete mailer --- app/mailers/welcome_mailer.rb | 8 -------- app/views/welcome_mailer/welcome_email.text.erb | 14 -------------- .../users/commentaires_controller_spec.rb | 1 - spec/mailers/welcome_mailer_spec.rb | 15 --------------- 4 files changed, 38 deletions(-) delete mode 100644 app/mailers/welcome_mailer.rb delete mode 100644 app/views/welcome_mailer/welcome_email.text.erb delete mode 100644 spec/mailers/welcome_mailer_spec.rb diff --git a/app/mailers/welcome_mailer.rb b/app/mailers/welcome_mailer.rb deleted file mode 100644 index 65b309eda..000000000 --- a/app/mailers/welcome_mailer.rb +++ /dev/null @@ -1,8 +0,0 @@ -class WelcomeMailer < ApplicationMailer - def welcome_email(user) - @user = user - - mail(to: user.email, - subject: "Création de votre compte demarches-simplifiees.fr") - end -end diff --git a/app/views/welcome_mailer/welcome_email.text.erb b/app/views/welcome_mailer/welcome_email.text.erb deleted file mode 100644 index 46de521d3..000000000 --- a/app/views/welcome_mailer/welcome_email.text.erb +++ /dev/null @@ -1,14 +0,0 @@ -Bienvenue sur demarches-simplifiees.fr, - -Nous vous remercions de vous être inscrit sur demarches-simplifiees.fr. Pour mémoire, voici quelques informations utiles : - - URL : <%= root_url %> - Login : <%= @user.email %> - -Oubli de mot de passe, pas de problème : - - <%= new_user_password_url %> - -Bonne journée, - -L'équipe demarches-simplifiees.fr diff --git a/spec/controllers/users/commentaires_controller_spec.rb b/spec/controllers/users/commentaires_controller_spec.rb index c8883c1ab..6bb7119cc 100644 --- a/spec/controllers/users/commentaires_controller_spec.rb +++ b/spec/controllers/users/commentaires_controller_spec.rb @@ -46,7 +46,6 @@ describe Users::CommentairesController, type: :controller do it 'Notification email is not send' do expect(NotificationMailer).not_to receive(:new_answer) - expect(WelcomeMailer).not_to receive(:deliver_now!) subject end diff --git a/spec/mailers/welcome_mailer_spec.rb b/spec/mailers/welcome_mailer_spec.rb deleted file mode 100644 index 3a1f187c8..000000000 --- a/spec/mailers/welcome_mailer_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'spec_helper' - -describe WelcomeMailer, type: :mailer do - describe ".welcome_email" do - let(:user) { create(:user) } - subject(:subject) { described_class.welcome_email(user) } - it { expect(subject.body).to match(root_url) } - it { expect(subject.body).to match(new_user_password_url) } - it { expect(subject.body).to match(user.email) } - it { expect(subject.body).to match('Bienvenue sur demarches-simplifiees.fr') } - it { expect(subject.body).to match('Nous vous remercions de vous être inscrit sur demarches-simplifiees.fr. Pour mémoire, voici quelques informations utiles :') } - - it { expect(subject.subject).to eq("Création de votre compte demarches-simplifiees.fr") } - end -end