Merge pull request #1202 from sgmap/simplify-mail-factory

Simplify factory girl configuration for mail templates
This commit is contained in:
gregoirenovel 2018-01-09 16:31:14 +01:00 committed by GitHub
commit c3f46f817d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 11 deletions

View file

@ -1,13 +1,15 @@
FactoryGirl.define do
factory :mail_template, class: Mails::ClosedMail do
factory :closed_mail, class: Mails::ClosedMail do
subject "Subject, voila voila"
body "Blabla ceci est mon body"
factory :dossier_submitted_mail_template, class: Mails::ReceivedMail
factory :received_mail, class: Mails::ReceivedMail
factory :dossier_refused_mail_template, class: Mails::RefusedMail
factory :refused_mail, class: Mails::RefusedMail
factory :dossier_en_instruction_mail_template, class: Mails::InitiatedMail do
factory :without_continuation_mail, class: Mails::WithoutContinuationMail
factory :initiated_mail, class: Mails::InitiatedMail do
subject "[TPS] Accusé de réception pour votre dossier nº --numéro du dossier--"
body "Votre administration vous confirme la bonne réception de votre dossier nº --numéro du dossier--"
end

View file

@ -1,6 +0,0 @@
FactoryGirl.define do
factory :received_mail, class: Mails::ReceivedMail do
subject "Mail d'accusé de bonne reception de votre dossier"
body "Votre dossier est correctement reçu"
end
end

View file

@ -2,7 +2,7 @@ require 'spec_helper'
describe 'admin/mail_templates/edit.html.haml', type: :view do
let(:procedure) { create(:procedure) }
let(:mail_template) { create(:mail_template, procedure: procedure) }
let(:mail_template) { create(:received_mail, procedure: procedure) }
let(:all_tags) { mail_template.tags }
before do