lib/telegram/bot/updates_controller/rspec_helpers.rb in telegram-bot-0.15.7 vs lib/telegram/bot/updates_controller/rspec_helpers.rb in telegram-bot-0.16.0
- old
+ new
@@ -11,20 +11,21 @@
let(:controller) do
controller_class.new(*controller_args).tap do |x|
x.extend Telegram::Bot::UpdatesController::Testing
end
end
- let(:controller_args) { [bot, deep_stringify(update)] }
+ let(:controller_args) { [bot, deep_stringify(update), webhook_request] }
let(:update) { {payload_type => payload} }
+ let(:webhook_request) { nil }
let(:payload_type) { :some_type }
let(:payload) { double(:payload) }
let(:bot) { Telegram::Bot::ClientStub.new(bot_name) }
let(:bot_name) { 'bot' }
let(:session) { controller.send(:session) }
# Process update.
- def dispatch(update = self.update, bot = self.bot)
- controller.dispatch_again(bot, deep_stringify(update))
+ def dispatch(update = self.update, bot = self.bot, webhook_request = self.webhook_request)
+ controller.dispatch_again(bot, deep_stringify(update), webhook_request)
end
# Same as `.as_json` but mocks-friendly.
def deep_stringify(input)
case input