1
0
зеркало из https://github.com/glebtv/telegram-bot.git synced 2026-09-03 17:55:52 +03:00

callback_query context for RSpec

Этот коммит содержится в:
Max Melentiev
2017-07-25 10:58:18 +03:00
родитель 6879618c00
Коммит 3dca35ba9a
2 изменённых файлов: 42 добавлений и 1 удалений

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

@@ -377,6 +377,13 @@ RSpec.describe TelegramWebhooksController, :telegram_bot do
subject { -> { dispatch_command :start } }
it { should respond_with_message 'Hi there!' }
end
# There is context for callback queries with related matchers.
describe '#hey_callback_query', :callback_query do
let(:data) { "hey:#{name}" }
let(:name) { 'Joe' }
it { should answer_callback_query('Hey Joe') }
it { should edit_current_message :text, text: 'Done' }
end
# For controller specs use