1
0
зеркало из https://github.com/glebtv/telegram-bot.git synced 2026-09-04 10:15:50 +03:00
Этот коммит содержится в:
Max Melentiev
2016-03-25 00:14:47 +03:00
родитель 1963533e33
Коммит d7a20a745c
4 изменённых файлов: 46 добавлений и 3 удалений

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

@@ -2,4 +2,22 @@ RSpec.describe Telegram::Bot do
it 'has a version number' do
expect(described_class::VERSION).not_to be nil
end
describe described_class::StaleChat do
describe '.match_response?' do
subject { ->(val) { described_class.match_response?(val) } }
it 'returns true for specific errors' do
expect(subject.call({})).to eq false
expect(subject.call('description' => 'test')).to eq false
expect(subject.call('description' => 'Error: bot was kicked from')).to eq true
expect(subject.call(
'description' => "Forbidden: can't write to private chat with deleted user"
)).to eq true
expect(subject.call(
'description' => 'Bad request: group chat is deactivated'
)).to eq true
end
end
end
end