Sha256: 69267467f8039c6fedd5f73222b7a5caf4226b93254661754a139e1328d8ac09

Contents?: true

Size: 714 Bytes

Versions: 14

Compression:

Stored size: 714 Bytes

Contents

require 'telegram/bot/rspec/integration/shared'
require 'rack/test'

RSpec.shared_context 'telegram/bot/integration/rack' do
  include_context 'telegram/bot/integration/shared'
  include Rack::Test::Methods

  let(:request_path) { raise '`let(:request_path) { path to bot }` is required' }
  let(:app) { raise '`let(:app) { your rack app here }` is required' }
  let(:request_headers) do
    {
      'ACCEPT' => 'application/json',
      'CONTENT_TYPE' => 'application/json',
    }
  end

  def dispatch(update)
    post request_path, update.to_json, request_headers
  end
end

Telegram::Bot::RSpec.with_include_context do |config|
  config.include_context 'telegram/bot/integration/rack', telegram_bot: :rack
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
telegram-bot-0.16.1 lib/telegram/bot/rspec/integration/rack.rb
telegram-bot-0.16.0 lib/telegram/bot/rspec/integration/rack.rb
telegram-bot-0.15.7 lib/telegram/bot/rspec/integration/rack.rb
telegram-bot-0.15.6 lib/telegram/bot/rspec/integration/rack.rb
telegram-bot-0.15.4 lib/telegram/bot/rspec/integration/rack.rb
telegram-bot-0.15.3 lib/telegram/bot/rspec/integration/rack.rb
telegram-bot-0.15.2 lib/telegram/bot/rspec/integration/rack.rb
telegram-bot-0.15.1 lib/telegram/bot/rspec/integration/rack.rb
telegram-bot-0.15.0 lib/telegram/bot/rspec/integration/rack.rb
telegram-bot-0.14.4 lib/telegram/bot/rspec/integration/rack.rb
telegram-bot-0.14.3 lib/telegram/bot/rspec/integration/rack.rb
telegram-bot-0.14.2 lib/telegram/bot/rspec/integration/rack.rb
telegram-bot-0.14.1 lib/telegram/bot/rspec/integration/rack.rb
telegram-bot-0.14.0 lib/telegram/bot/rspec/integration/rack.rb