From 9defa42f40022bf8d555f55ac59c1420be0ffa3f Mon Sep 17 00:00:00 2001 From: Max Melentiev Date: Thu, 11 May 2017 14:01:42 +0600 Subject: [PATCH] Add notes on testing multiple bots to readme Fixes #29 --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 668723a..f37d6b4 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,8 @@ Run it on your local machine in 1 minute! And here is [app teamplate](https://github.com/telegram-bot-rb/rails_template) to generate clean app in seconds. +Examples and cookbook in [wiki](https://github.com/telegram-bot-rb/telegram-bot/wiki). + ## Installation Add this line to your application's Gemfile: @@ -341,6 +343,8 @@ Telegram::Bot::ClientStub.stub_all! RSpec.configure do |config| # ... config.after { Telegram.bot.reset } + # or for multiple bots: + config.after { Telegram.bots.each_value(&:reset) } # ... end ``` @@ -376,6 +380,10 @@ expect(&process_update). to make_telegram_request(bot, :sendMessage, hash_including(text: 'msg text')) ``` +Place integration tests inside `spec/requests` +when using RSpec's `infer_spec_type_from_file_location!`, +or just add `type: :request` to `describe`. + See sample app for more examples. ### Deploying