mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-29 19:40:23 -05:00
15 lines
531 B
Ruby
15 lines
531 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
shared_examples 'localized subject' do |*args, **kwrest|
|
||
|
it 'renders subject localized for the locale of the receiver' do
|
||
|
locale = :de
|
||
|
receiver.update!(locale: locale)
|
||
|
expect(mail.subject).to eq I18n.t(*args, **kwrest.merge(locale: locale))
|
||
|
end
|
||
|
|
||
|
it 'renders subject localized for the default locale if the locale of the receiver is unavailable' do
|
||
|
receiver.update!(locale: nil)
|
||
|
expect(mail.subject).to eq I18n.t(*args, **kwrest.merge(locale: I18n.default_locale))
|
||
|
end
|
||
|
end
|