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

Support for testing bots in poller mode and non-Rails apps

Этот коммит содержится в:
Max Melentiev
2018-05-25 18:48:38 +03:00
родитель 050df20533
Коммит 4d76941d03
18 изменённых файлов: 331 добавлений и 170 удалений

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

@@ -1,9 +1,11 @@
require 'telegram/bot/updates_controller/testing'
require 'telegram/bot/rspec/message_helpers'
require 'telegram/bot/rspec/callback_query_helpers'
RSpec.shared_context 'telegram/bot/updates_controller' do
include Telegram::Bot::RSpec::ClientMatchers
include_context 'telegram/bot/message_helpers'
include_context 'telegram/bot/callback_query', :callback_query
let(:controller_class) { described_class }
let(:controller) do
@@ -34,8 +36,6 @@ RSpec.shared_context 'telegram/bot/updates_controller' do
end
end
RSpec.configure do |config|
if config.respond_to?(:include_context)
config.include_context 'telegram/bot/updates_controller', type: :telegram_bot_controller
end
Telegram::Bot::RSpec.with_include_context do |config|
config.include_context 'telegram/bot/updates_controller', type: :telegram_bot_controller
end