зеркало из
https://github.com/glebtv/telegram-bot.git
synced 2026-09-07 19:35:52 +03:00
Support for testing bots in poller mode and non-Rails apps
Этот коммит содержится в:
14
lib/telegram/bot/rspec/integration/poller.rb
Обычный файл
14
lib/telegram/bot/rspec/integration/poller.rb
Обычный файл
@@ -0,0 +1,14 @@
|
||||
require 'telegram/bot/rspec/integration/shared'
|
||||
|
||||
RSpec.shared_context 'telegram/bot/integration/poller' do
|
||||
include_context 'telegram/bot/integration/shared'
|
||||
let(:controller_class) { described_class }
|
||||
|
||||
def dispatch(update)
|
||||
controller_class.dispatch(bot, update.as_json)
|
||||
end
|
||||
end
|
||||
|
||||
Telegram::Bot::RSpec.with_include_context do |config|
|
||||
config.include_context 'telegram/bot/integration/poller', telegram_bot: :poller
|
||||
end
|
||||
Ссылка в новой задаче
Block a user