зеркало из
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
27 строки
708 B
Ruby
27 строки
708 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.shared_examples 'shared integration examples' do
|
|
let(:bot) { Telegram::Bot::ClientStub.new('token') }
|
|
let(:controller_class) do
|
|
Class.new(Telegram::Bot::UpdatesController) do
|
|
def start!(data = nil, *)
|
|
respond_with :message, text: "Hi #{data}"
|
|
end
|
|
|
|
def callback_query(data, *)
|
|
answer_callback_query "pong: #{data}"
|
|
end
|
|
end
|
|
end
|
|
|
|
describe '#start' do
|
|
subject { -> { dispatch_command(:start, :test_data) } }
|
|
it { should respond_with_message('Hi test_data') }
|
|
end
|
|
|
|
describe '#callback_query', :callback_query do
|
|
let(:data) { :test_data }
|
|
it { should answer_callback_query "pong: #{data}" }
|
|
end
|
|
end
|