зеркало из
https://github.com/glebtv/telegram-bot.git
synced 2026-09-06 11:05:51 +03:00
fix reply_to_message_id
Этот коммит содержится в:
@@ -14,7 +14,7 @@ module Telegram
|
|||||||
payload = self.payload
|
payload = self.payload
|
||||||
params = params.merge(
|
params = params.merge(
|
||||||
chat_id: (chat && chat['id'] or raise 'Can not reply_with when chat is not present'),
|
chat_id: (chat && chat['id'] or raise 'Can not reply_with when chat is not present'),
|
||||||
reply_to_message: payload && payload['message_id'],
|
reply_to_message_id: payload && payload['message_id'],
|
||||||
)
|
)
|
||||||
bot.public_send(method, params)
|
bot.public_send(method, params)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ RSpec.describe Telegram::Bot::UpdatesController do
|
|||||||
expect(controller).to receive(:chat) { chat }
|
expect(controller).to receive(:chat) { chat }
|
||||||
expect(bot).to receive("send_#{type}").with(params.merge(
|
expect(bot).to receive("send_#{type}").with(params.merge(
|
||||||
chat_id: chat['id'],
|
chat_id: chat['id'],
|
||||||
reply_to_message: payload[:message_id],
|
reply_to_message_id: payload[:message_id],
|
||||||
)) { result }
|
)) { result }
|
||||||
should eq result
|
should eq result
|
||||||
end
|
end
|
||||||
@@ -29,7 +29,7 @@ RSpec.describe Telegram::Bot::UpdatesController do
|
|||||||
it 'sets chat_id & reply_to_message' do
|
it 'sets chat_id & reply_to_message' do
|
||||||
expect(bot).to receive("send_#{type}").with(params.merge(
|
expect(bot).to receive("send_#{type}").with(params.merge(
|
||||||
chat_id: chat['id'],
|
chat_id: chat['id'],
|
||||||
reply_to_message: nil,
|
reply_to_message_id: nil,
|
||||||
)) { result }
|
)) { result }
|
||||||
should eq result
|
should eq result
|
||||||
end
|
end
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user