From 903e14a3e5d1b35550dc340ca6db79591d4e7b17 Mon Sep 17 00:00:00 2001 From: Maximilian Haack Date: Sat, 25 Jan 2020 11:34:48 +0100 Subject: [PATCH] Fix make_telegram_request examples in README (#129) --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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)