1
0
зеркало из https://github.com/glebtv/telegram-bot.git synced 2026-08-28 15:26:18 +03:00

Class-level helper for lazy translations

Этот коммит содержится в:
Max Melentiev
2018-06-07 14:26:13 +06:00
родитель 7ff89d012c
Коммит b5f4c97f44
3 изменённых файлов: 26 добавлений и 0 удалений

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

@@ -14,4 +14,18 @@ RSpec.describe Telegram::Bot::UpdatesController::Translation do
controller.t('.hello')
end
end
describe described_class::ClassMethods do
describe '#translate' do
let(:controller_class) do
double(controller_path: 'telegram/webhooks').
tap { |x| x.extend(described_class) }
end
it 'uses controller_path for lazy translations' do
expect(I18n).to receive(:translate).with('telegram.webhooks.hello', {})
controller_class.t('.hello')
end
end
end
end