Sha256: e5daeee21d737f606a6176de7ac6ed415518501e98f636dc3ecf877f9c9b75f4

Contents?: true

Size: 516 Bytes

Versions: 17

Compression:

Stored size: 516 Bytes

Contents

require 'json'
require 'sinatra'

class SampleApp < Sinatra::Application
  before do
      content_type 'application/json'
    end
  get '/' do
    {foo: "bar"}.to_json
  end
end

Airborne.configure do |config|
  config.rack_app = SampleApp
end

describe 'rack app' do
  it 'should allow requests against a sinatra app' do
    get '/'
    expect_json_types({foo: :string})
  end

  it 'should ensure correct values from sinatra app' do
    get '/'
    expect{expect_json_types({foo: :int})}.to raise_error
  end 
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
airborne-0.1.15 spec/airborne/rack/rack_sinatra_spec.rb
airborne-0.1.14 spec/airborne/rack/rack_sinatra_spec.rb
airborne-0.1.13 spec/airborne/rack/rack_sinatra_spec.rb
airborne-0.1.12 spec/airborne/rack/rack_sinatra_spec.rb
airborne-0.1.11 spec/airborne/rack/rack_sinatra_spec.rb
airborne-0.1.10 spec/airborne/rack/rack_sinatra_spec.rb
airborne-0.1.9 spec/airborne/rack/rack_sinatra_spec.rb
airborne-0.1.8 spec/airborne/rack/rack_sinatra_spec.rb
airborne-0.1.7 spec/airborne/rack/rack_sinatra_spec.rb
airborne-0.1.6 spec/airborne/rack/rack_sinatra_spec.rb
airborne-0.1.5 spec/airborne/rack/rack_sinatra_spec.rb
airborne-0.1.4 spec/airborne/rack/rack_sinatra_spec.rb
airborne-0.1.3 spec/airborne/rack/rack_sinatra_spec.rb
airborne-0.1.2 spec/airborne/rack/rack_sinatra_spec.rb
airborne-0.1.1 spec/airborne/rack/rack_sinatra_spec.rb
airborne-0.0.23 spec/airborne/rack/rack_sinatra_spec.rb
airborne-0.0.22 spec/airborne/rack_sinatra_spec.rb