diff --git a/README.md b/README.md index 8e6bd57..5768552 100644 --- a/README.md +++ b/README.md @@ -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)