зеркало из
https://github.com/glebtv/telegram-bot.git
synced 2026-08-28 15:26:18 +03:00
Fix make_telegram_request examples in README (#129)
Этот коммит содержится в:
коммит произвёл
Max Melentiev
родитель
da31cd148a
Коммит
903e14a3e5
@@ -475,10 +475,11 @@ RSpec.describe TelegramWebhooksController, telegram_bot: :rails do
|
||||
# dispatch_command(cmd, *args)
|
||||
|
||||
# Available matchers can be found in Telegram::Bot::RSpec::ClientMatchers.
|
||||
it 'shows usage of basic matchers'
|
||||
# The most basic one is #make_telegram_request(bot, endpoint, params_matcher)
|
||||
expect { dispatch_command(:start) }.
|
||||
to make_telegram_request(bot, :sendMessage, hash_including(text: 'msg text'))
|
||||
it 'shows usage of basic matchers' do
|
||||
# The most basic one is #make_telegram_request(bot, action).
|
||||
# It works similar to `receive` matcher and supports chaining `.with(args).exactly(n).times`.
|
||||
expect { dispatch_command(:start) }.to make_telegram_request(bot, :sendMessage).
|
||||
with(hash_including(text: 'msg text'))
|
||||
|
||||
# There are some shortcuts for dispatching basic updates and testing responses.
|
||||
expect { dispatch_message('Hi') }.to send_telegram_message(bot, /msg regexp/, some: :option)
|
||||
|
||||
Ссылка в новой задаче
Block a user