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

Fix sending File objects in nested objects in sendMediaGroup

Этот коммит содержится в:
Max Melentiev
2021-09-08 20:05:31 +01:00
родитель 2d73d1c879
Коммит 5b9706ed47
5 изменённых файлов: 115 добавлений и 30 удалений

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

@@ -71,25 +71,6 @@ RSpec.describe Telegram::Bot::Client do
end
end
describe '.prepare_body' do
subject { described_class.prepare_body(input) }
context 'when plain hash is given' do
let(:input) { {a: 1, b: '2', c: nil} }
it { should eq input }
end
context 'when nested hash is given' do
let(:input) { {a: 1, b: '2', c: [1, 2], d: {a: 1}, e: {b: []}} }
it 'encodes nested hashes to json' do
expected = input.dup
%i[c d e].each { |x| expected[x] = expected[x].to_json }
should eq expected
end
end
end
describe '.prepare_async_args' do
subject { described_class.prepare_async_args(*input) }
let(:input) { [:action, a: 1, b: :sym, c: [:other], 'd' => 'str'] }