зеркало из
https://github.com/glebtv/telegram-bot.git
synced 2026-09-03 17:55:52 +03:00
callback_query context for RSpec
Этот коммит содержится в:
@@ -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
|
||||
|
||||
Ссылка в новой задаче
Block a user