-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow from address to fall back to parent mailer
- Loading branch information
1 parent
cd0e0ed
commit 744ac75
Showing
3 changed files
with
17 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,4 +35,14 @@ class Passwordless::MailerTest < ActionMailer::TestCase | |
assert_match /sign in: hello\n/, email.body.to_s | ||
assert_match %r{/admins/sign_in/#{session.identifier}/hello}, email.body.to_s | ||
end | ||
|
||
test("without default_from_address falls back to parent_mailer") do | ||
WithConfig.with_config({default_from_address: nil, parent_mailer: "ApplicationMailer"}) do | ||
email = Passwordless::Mailer.sign_in( | ||
Passwordless::Session.create!(authenticatable: users(:alice), token: "hello") | ||
) | ||
|
||
assert_equal ["[email protected]"], email.from | ||
end | ||
end | ||
end |