Sha256: ff1676eef6e701532ae9ac1996732a420fe2b6e5be50f5859ecef935839e3222

Contents?: true

Size: 747 Bytes

Versions: 9

Compression:

Stored size: 747 Bytes

Contents

require 'sinatra'

require 'apps/sinatra/sinatra_test_app'
require 'integration/shared_examples/rack_examples'

RSpec.describe "Sinatra integration specs" do
  let(:app) { SinatraTestApp }

  include_examples 'rack examples'

  describe "context payload" do
    before { stub_request(:post, endpoint).to_return(status: 200, body: '') }

    it "includes version" do
      get '/crash'
      sleep 2

      body = /"context":{.*"versions":{"sinatra":"\d\./
      expect(a_request(:post, endpoint).with(body: body)).to have_been_made
    end

    it "includes route" do
      get '/crash'
      sleep 2

      body = %r("context":{.*"route":"\/crash".*})
      expect(a_request(:post, endpoint).with(body: body)).to have_been_made
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
airbrake-9.2.1 spec/integration/sinatra/sinatra_spec.rb
airbrake-9.2.0 spec/integration/sinatra/sinatra_spec.rb
airbrake-9.1.0 spec/integration/sinatra/sinatra_spec.rb
airbrake-9.0.2 spec/integration/sinatra/sinatra_spec.rb
airbrake-9.0.1 spec/integration/sinatra/sinatra_spec.rb
airbrake-9.0.0 spec/integration/sinatra/sinatra_spec.rb
airbrake-8.3.2 spec/integration/sinatra/sinatra_spec.rb
airbrake-8.3.1 spec/integration/sinatra/sinatra_spec.rb
airbrake-8.3.0 spec/integration/sinatra/sinatra_spec.rb