Fix failing tests and improve email template consistency

- Fix onboarding controller test by using consistent application name
- Fix ticket mailer template error by correcting variable reference (@user.first_name)
- Update event reminder template to use configurable app name
- Refactor mailer tests to properly handle multipart email content
- Update test assertions to match actual template content
- Remove duplicate migration for onboarding field
- Add documentation for test fixes and solutions
This commit is contained in:
kbe
2025-09-08 12:36:33 +02:00
parent d1308bc988
commit 8f9795d773
11 changed files with 402 additions and 31 deletions

View File

@@ -11,7 +11,7 @@ class OnboardingController < ApplicationController
current_user.update!(onboarding_params)
current_user.complete_onboarding!
flash[:notice] = "Bienvenue sur AperoNight ! Votre profil a été configuré avec succès."
flash[:notice] = "Bienvenue sur #{Rails.application.config.app_name} ! Votre profil a été configuré avec succès."
redirect_to dashboard_path
else
flash.now[:alert] = "Veuillez remplir tous les champs requis."

View File

@@ -71,7 +71,7 @@
<p class="text-sm text-gray-500">
Vous pourrez modifier ces informations plus tard.
</p>
<%= form.submit "Finaliser mon profil",
<%= form.submit "Compléter mon profil",
class: "w-full px-8 py-3 bg-purple-600 text-white font-semibold rounded-lg hover:bg-purple-700 focus:ring-2 focus:ring-purple-500 focus:ring-offset-2 transition-colors cursor-pointer" %>
</div>
</div>

View File

@@ -1,6 +1,6 @@
<div style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; max-width: 600px; margin: 0 auto; padding: 20px; background-color: #f8f9fa; border-radius: 8px;">
<div style="text-align: center; padding: 20px 0; border-bottom: 1px solid #e9ecef;">
<h1 style="color: #4c1d95; margin: 0; font-size: 28px;">ApéroNight</h1>
<h1 style="color: #4c1d95; margin: 0; font-size: 28px;"><%= ENV.fetch("APP_NAME", "Aperonight") %></h1>
<p style="color: #6c757d; margin: 10px 0 0;">Rappel d'événement</p>
</div>

View File

@@ -5,7 +5,7 @@
</div>
<div style="background-color: white; border-radius: 8px; padding: 30px; margin: 20px 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
<% if user.first_name %>
<% if @user.first_name %>
<h2 style="color: #212529; margin-top: 0;">Bonjour <%= @user.first_name %>,</h2>
<% else %>
<h2 style="color: #212529; margin-top: 0;">Bonjour <%= @user.email.split('@').first %>,</h2>