зеркало из
https://github.com/glebtv/telegram-bot.git
synced 2026-08-28 15:26:18 +03:00
* Update rubopcop [WIP] * Further rubocop fixes * Fix rubocop-rails cops * Fix spec * Disable rubocop suggestions * Run rubocop in github actions rather than in codeclimate
25 строки
651 B
Ruby
25 строки
651 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'integration_helper'
|
|
|
|
RSpec.describe DefaultBotController, telegram_bot: :rails do
|
|
describe '#start' do
|
|
subject { -> { dispatch_command :start } }
|
|
it { should respond_with_message 'from default' }
|
|
end
|
|
|
|
describe '#load_session' do
|
|
subject { -> { dispatch_command :load_session } }
|
|
it { should_not raise_error }
|
|
end
|
|
|
|
describe '#dispatch' do
|
|
it 'provides webhook_request' do
|
|
expect(described_class).to receive(:dispatch).
|
|
with(bot, hash_including('message'), instance_of(ActionDispatch::Request)).
|
|
and_call_original
|
|
dispatch_message :test
|
|
end
|
|
end
|
|
end
|