зеркало из
https://github.com/glebtv/telegram-bot.git
synced 2026-09-05 10:45:49 +03:00
Support for testing bots in poller mode and non-Rails apps
Этот коммит содержится в:
14
lib/telegram/bot/rspec/integration/shared.rb
Обычный файл
14
lib/telegram/bot/rspec/integration/shared.rb
Обычный файл
@@ -0,0 +1,14 @@
|
||||
require 'active_support/json'
|
||||
require 'telegram/bot'
|
||||
require 'telegram/bot/rspec/message_helpers'
|
||||
require 'telegram/bot/rspec/callback_query_helpers'
|
||||
|
||||
RSpec.shared_context 'telegram/bot/integration/shared' do
|
||||
include Telegram::Bot::RSpec::ClientMatchers
|
||||
include_context 'telegram/bot/message_helpers'
|
||||
include_context 'telegram/bot/callback_query', :callback_query
|
||||
|
||||
let(:bot) { Telegram.bot }
|
||||
let(:clear_session?) { described_class.respond_to?(:session_store) }
|
||||
before { described_class.session_store.try!(:clear) if clear_session? }
|
||||
end
|
||||
Ссылка в новой задаче
Block a user