1
0
зеркало из https://github.com/glebtv/telegram-bot.git synced 2026-09-07 19:35:52 +03:00
Этот коммит содержится в:
Max Melentiev
2016-11-07 20:07:55 +03:00
родитель ececfa660e
Коммит 194fc78202
9 изменённых файлов: 275 добавлений и 3 удалений

Просмотреть файл

@@ -336,6 +336,23 @@ There are also some helpers for controller tests.
Check out `telegram/bot/updates_controller/rspec_helpers` and
`telegram/bot/updates_controller/testing`.
Built-in RSpec matchers will help you to write tests fast:
```ruby
include Telegram::Bot::RSpec::ClientMatchers # no need if you already use controller herlpers
expect(&process_update).to send_telegram_message(bot, /msg regexp/, some: :option)
expect(&process_update).
to make_telegram_request(bot, :sendMessage, hash_including(text: 'msg text'))
# controller specs are even simplier:
describe '#start' do
subject { -> { dispatch_message '/start' } }
it { should respond_with_message(/Hello/) }
end
# See sample app for more examples.
```
### Deploying
Use `rake telegram:bot:set_webhook` to update webhook url for all configured bots.