зеркало из
https://github.com/glebtv/telegram-bot.git
synced 2026-09-06 11:05:51 +03:00
Translation helper strips ! from action name for lazy translations
Этот коммит содержится в:
17
spec/telegram/bot/updates_controller/translation_spec.rb
Обычный файл
17
spec/telegram/bot/updates_controller/translation_spec.rb
Обычный файл
@@ -0,0 +1,17 @@
|
||||
RSpec.describe Telegram::Bot::UpdatesController::Translation do
|
||||
describe '#translate' do
|
||||
let(:controller) do
|
||||
double(
|
||||
controller_path: 'telegram/webhooks',
|
||||
action_name: 'start!',
|
||||
).tap { |x| x.extend(described_class) }
|
||||
end
|
||||
|
||||
it 'uses action_name without ! for lazy translations' do
|
||||
expect(I18n).to receive(:translate).with('telegram.webhooks.start.hello',
|
||||
default: [:'telegram.webhooks.hello'],
|
||||
)
|
||||
controller.t('.hello')
|
||||
end
|
||||
end
|
||||
end
|
||||
Ссылка в новой задаче
Block a user