]> git.openstreetmap.org Git - rails.git/commit
Enable ActionMailer Previews
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 15 Oct 2025 17:10:06 +0000 (18:10 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Thu, 16 Oct 2025 08:56:19 +0000 (09:56 +0100)
commitb8f584407e0aef291b96d753c4a7355f3a45cb21
tree1df0f111d9299c5b09f3cfc9a35cd91667a92e01
parent6ff5918bd07673fb8db633701f77abeb16c5a1bd
Enable ActionMailer Previews

The previews run using the development database, which may or may not already contain
sufficient records (e.g. diary comments). So to avoid failures, we generate content
using factory bot, and to avoid filling your development database with duplicate data,
we run the previews inside a transaction.

If you manually create records in the database that collide with factory bot (e.g. users
with the same email pattern as the factory) then you'll need to update your manual records
to avoid collisions.
CONFIGURE.md
test/mailers/previews/user_mailer_preview.rb [new file with mode: 0644]