1
0
зеркало из https://github.com/glebtv/telegram-bot.git synced 2026-09-05 02:35:50 +03:00
Этот коммит содержится в:
Max Melentiev
2021-06-25 19:31:28 +01:00
родитель af229c8bcc
Коммит a49ef51da9
6 изменённых файлов: 24 добавлений и 9 удалений

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

@@ -9,14 +9,19 @@ RSpec.describe Telegram::Bot::UpdatesController::TypedUpdate do
context 'when `update` is a virtus model' do
subject { controller }
unique_types = Telegram::Bot::UpdatesController::PAYLOAD_TYPES - %w[
unique_types = (Telegram::Bot::UpdatesController::PAYLOAD_TYPES - %w[
edited_message
channel_post
edited_channel_post
]
unique_types.each do |type|
my_chat_member
chat_member
]).
map { |x| [x, Telegram::Bot::Types.const_get(type.camelize)] }.to_h.
merge(
'chat_member' => Telegram::Bot::Types::ChatMemberUpdated
)
unique_types.each do |type, type_class|
context "with #{type}" do
type_class = Telegram::Bot::Types.const_get(type.camelize)
let(:payload_type) { type }
let(:payload) do
{}.tap do |result|