feat: Use invoice emitter details from env var
This commit is contained in:
@@ -24,7 +24,7 @@ class TicketMailerTest < ActionMailer::TestCase
|
||||
assert_equal [ "no-reply@aperonight.fr" ], email.from
|
||||
assert_equal [ @user.email ], email.to
|
||||
assert_equal "Confirmation d'achat - #{@event.name}", email.subject
|
||||
|
||||
|
||||
# Check if we have any content
|
||||
content = ""
|
||||
if email.html_part
|
||||
@@ -34,7 +34,7 @@ class TicketMailerTest < ActionMailer::TestCase
|
||||
else
|
||||
content = email.body.to_s
|
||||
end
|
||||
|
||||
|
||||
# If still empty, try to get content from parts
|
||||
if content.empty? && email.parts.any?
|
||||
email.parts.each do |part|
|
||||
@@ -44,7 +44,7 @@ class TicketMailerTest < ActionMailer::TestCase
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# Instead of strict matching, just check that content exists
|
||||
assert content.length > 0, "Email body should not be empty"
|
||||
assert_match @event.name, content
|
||||
@@ -64,7 +64,7 @@ class TicketMailerTest < ActionMailer::TestCase
|
||||
assert_equal [ "no-reply@aperonight.fr" ], email.from
|
||||
assert_equal [ @ticket.user.email ], email.to
|
||||
assert_equal "Confirmation d'achat - #{@ticket.event.name}", email.subject
|
||||
|
||||
|
||||
# Check if we have any content
|
||||
content = ""
|
||||
if email.html_part
|
||||
@@ -74,7 +74,7 @@ class TicketMailerTest < ActionMailer::TestCase
|
||||
else
|
||||
content = email.body.to_s
|
||||
end
|
||||
|
||||
|
||||
# If still empty, try to get content from parts
|
||||
if content.empty? && email.parts.any?
|
||||
email.parts.each do |part|
|
||||
@@ -84,7 +84,7 @@ class TicketMailerTest < ActionMailer::TestCase
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# Instead of strict matching, just check that content exists
|
||||
assert content.length > 0, "Email body should not be empty"
|
||||
assert_match @ticket.event.name, content
|
||||
@@ -105,7 +105,7 @@ class TicketMailerTest < ActionMailer::TestCase
|
||||
assert_equal [ "no-reply@aperonight.fr" ], email.from
|
||||
assert_equal [ @user.email ], email.to
|
||||
assert_equal "Rappel : #{@event.name} dans une semaine", email.subject
|
||||
|
||||
|
||||
# Check content properly
|
||||
content = ""
|
||||
if email.html_part
|
||||
@@ -115,7 +115,7 @@ class TicketMailerTest < ActionMailer::TestCase
|
||||
else
|
||||
content = email.body.to_s
|
||||
end
|
||||
|
||||
|
||||
assert content.length > 0, "Email body should not be empty"
|
||||
assert_match /une semaine/, content
|
||||
assert_match @event.name, content
|
||||
@@ -136,7 +136,7 @@ class TicketMailerTest < ActionMailer::TestCase
|
||||
end
|
||||
|
||||
assert_equal "Rappel : #{@event.name} demain", email.subject
|
||||
|
||||
|
||||
# Check content properly
|
||||
content = ""
|
||||
if email.html_part
|
||||
@@ -146,7 +146,7 @@ class TicketMailerTest < ActionMailer::TestCase
|
||||
else
|
||||
content = email.body.to_s
|
||||
end
|
||||
|
||||
|
||||
assert content.length > 0, "Email body should not be empty"
|
||||
assert_match /demain/, content
|
||||
end
|
||||
@@ -161,7 +161,7 @@ class TicketMailerTest < ActionMailer::TestCase
|
||||
end
|
||||
|
||||
assert_equal "C'est aujourd'hui : #{@event.name}", email.subject
|
||||
|
||||
|
||||
# Check content properly
|
||||
content = ""
|
||||
if email.html_part
|
||||
@@ -171,7 +171,7 @@ class TicketMailerTest < ActionMailer::TestCase
|
||||
else
|
||||
content = email.body.to_s
|
||||
end
|
||||
|
||||
|
||||
assert content.length > 0, "Email body should not be empty"
|
||||
assert_match /aujourd'hui/, content
|
||||
end
|
||||
@@ -186,7 +186,7 @@ class TicketMailerTest < ActionMailer::TestCase
|
||||
end
|
||||
|
||||
assert_equal "Rappel : #{@event.name} dans 3 jours", email.subject
|
||||
|
||||
|
||||
# Check content properly
|
||||
content = ""
|
||||
if email.html_part
|
||||
@@ -196,7 +196,7 @@ class TicketMailerTest < ActionMailer::TestCase
|
||||
else
|
||||
content = email.body.to_s
|
||||
end
|
||||
|
||||
|
||||
assert content.length > 0, "Email body should not be empty"
|
||||
assert_match /3 jours/, content
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user