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

Use bang-methods as actions for commands

Этот коммит содержится в:
Max Melentiev
2018-05-28 12:30:47 +03:00
родитель 8db3204609
Коммит 9310fa613b
15 изменённых файлов: 225 добавлений и 190 удалений

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

@@ -28,7 +28,7 @@ RSpec.describe Telegram::Bot::UpdatesController::MessageContext do
[:method_result, *args]
end
def action(*args)
def action!(*args)
[:action_result, *args]
end
@@ -109,7 +109,7 @@ RSpec.describe Telegram::Bot::UpdatesController::MessageContext do
end
context 'when context is action`s name but not mapped' do
before { session[:context] = :action }
before { session[:context] = :action! }
its(:call) { should eq [:action_result, *text.split] }
it { should_not change(controller, :filter_done) }
it { should change { session[:context] }.to nil }