1
0
зеркало из https://github.com/glebtv/telegram-bot.git synced 2026-09-05 02:35:50 +03:00
Этот коммит содержится в:
Max Melentiev
2016-03-14 14:19:57 +06:00
родитель 225290b677
Коммит c04884040d
4 изменённых файлов: 20 добавлений и 2 удалений

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

@@ -33,6 +33,17 @@ RSpec.describe Telegram::Bot::Client do
end
end
context 'when input is a Symbol' do
let(:input) { :bot_1 }
before { allow(Telegram).to receive(:bots) { {bot_1: instance} } }
it { should eq Telegram.bots[:bot_1] }
context 'and there is no such bot' do
let(:input) { :invalid }
it { expect { subject }.to raise_error(/not configured/) }
end
end
context 'when input is an array' do
let!(:input) { ['other_token', instance, token: token, username: username] }
let(:result_2) { double(:result_2) }

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

@@ -78,6 +78,7 @@ RSpec.describe Telegram::Bot::RoutesHelper do
{
bot => controller,
'custom_token' => [other_controller, as: :custom_route, option: :other_val],
other: controller,
},
option: :val,
]
@@ -90,7 +91,8 @@ RSpec.describe Telegram::Bot::RoutesHelper do
other_controller,
:custom_route,
option: :other_val,
]
],
[Telegram.bots[:other], controller, 'other_telegram_webhook', option: :val]
end
end