1
0
зеркало из https://github.com/glebtv/telegram-bot.git synced 2026-09-04 10:15:50 +03:00
Этот коммит содержится в:
Max Melentiev
2016-02-22 22:53:59 +06:00
Коммит 37a63f7b23
29 изменённых файлов: 1333 добавлений и 0 удалений

18
spec/telegram/bot/middleware_spec.rb Обычный файл
Просмотреть файл

@@ -0,0 +1,18 @@
RSpec.describe Telegram::Bot::Middleware do
let(:instance) { described_class.new bot, controller }
let(:bot) { double(:bot) }
let(:controller) { double(:controller, dispatch: :dispatch_result) }
describe '#call' do
subject { instance.call(env) }
let(:env) { {'action_dispatch.request.request_parameters' => json_body} }
let(:json_body) { double(:json_body) }
it 'calls dispatch on controller' do
expect(controller).to receive(:dispatch).with(bot, json_body)
subject
end
it { should eq [200, {}, ''] }
end
end