Files
openfoodnetwork/spec/support/email_helper.rb
Maikel Linke 9998025687 Remove useless test header setup for emails
Once upon a time we needed a helper to set the `from` header of emails.
This is now set in the ApplicationMailer and not necessary any more.
2023-04-20 12:15:34 +10:00

18 lines
466 B
Ruby

# frozen_string_literal: true
module OpenFoodNetwork
module EmailHelper
# Ensures the value `perform_deliveries` had is restored. This saves us
# from messing up with the test suite's global state which is cause of
# trouble.
def performing_deliveries
old_value = ActionMailer::Base.perform_deliveries
ActionMailer::Base.perform_deliveries = true
yield
ActionMailer::Base.perform_deliveries = old_value
end
end
end