1
0
зеркало из https://github.com/glebtv/telegram-bot.git synced 2026-09-06 02:55:50 +03:00

Translation helper strips ! from action name for lazy translations

Этот коммит содержится в:
Max Melentiev
2018-06-07 14:10:22 +06:00
родитель 6dd705fe89
Коммит 7ff89d012c
4 изменённых файлов: 66 добавлений и 8 удалений

Просмотреть файл

@@ -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