I'm using the Seed-Fu gem to populate my database. So, I have this in one of my seed files:
User.seed_once(:email) do |user|
user.id = 1
user.email = "[email protected]"
user.first_name = "First"
user.last_name = "Last"
user.confirmation_sent_at = Time.zone.now - 1.hour
user.confirmed_at = Time.zone.now
user.roles = [root,staff]
user.permissions = Permission.all
end
From what I've read, that should prevent Devise from sending a confirmation email. However, it is not, so (since I'm using the Letter Opener gem) my browser is being flooded with confirmation emails. Anyone know why this is happening and how I can convince Devise to not send these emails whilst I'm seeding?
SOLUTION:
Based on anothermh's answer below, I added Devise::Mailer.perform_deliveries = false
to the top of this fixture file. Then, I found my final fixture file and added Devise::Mailer.perform_deliveries = true
to the end of that to make sure emails would be sent when actually using the app. Thank you so much, folks!