Skip to content

Commit f3e0f41

Browse files
committed
Add test for default locale handling
1 parent 93fd612 commit f3e0f41

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

test/mailers/owners_test.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,16 @@ class OwnersMailerTest < ActionMailer::TestCase
1919
assert_equal email.subject, "Your role was updated for the #{@rubygem.name} gem"
2020
end
2121
end
22+
23+
context "#owner_added" do
24+
should "use default locale regardless of ambient I18n.locale" do
25+
I18n.with_locale(:de) do
26+
email = OwnersMailer.owner_added(@owner.id, @maintainer.id, @owner.id, @rubygem.id)
27+
28+
assert_emails(1) { email.deliver_now }
29+
assert_equal "User #{@maintainer.display_handle} was added as an owner to the #{@rubygem.name} gem", email.subject
30+
assert_match "OWNER ADDED", email.body.to_s
31+
end
32+
end
33+
end
2234
end

0 commit comments

Comments
 (0)