Sha256: ee878bd9f8da1fe86c766a96320b713f6915f54f01347ce50dc4a5662af5ec5d

Contents?: true

Size: 581 Bytes

Versions: 21

Compression:

Stored size: 581 Bytes

Contents

require File.dirname(__FILE__) + '/helper'

class RequestTest < Test::Unit::TestCase
  it 'responds to #user_agent' do
    request = Sinatra::Request.new({'HTTP_USER_AGENT' => 'Test'})
    assert request.respond_to?(:user_agent)
    assert_equal 'Test', request.user_agent
  end

  it 'parses POST params when Content-Type is form-dataish' do
    request = Sinatra::Request.new(
      'REQUEST_METHOD' => 'PUT',
      'CONTENT_TYPE' => 'application/x-www-form-urlencoded',
      'rack.input' => StringIO.new('foo=bar')
    )
    assert_equal 'bar', request.params['foo']
  end
end

Version data entries

21 entries across 21 versions & 4 rubygems

Version Path
sinatra-sinatra-0.10.0 test/request_test.rb
sinatra-sinatra-0.10.1 test/request_test.rb
sinatra-sinatra-0.9.1.3 test/request_test.rb
sinatra-sinatra-0.9.2 test/request_test.rb
sinatra-0.9.6 test/request_test.rb
sinatra-0.9.5 test/request_test.rb
akamai_bookmarklet-0.1.2 vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/request_test.rb
middleman-0.13.1 lib/middleman/vendor/gems/ruby/1.9.1/gems/sinatra-0.9.4/test/request_test.rb
akamai_bookmarklet-0.1.1 vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/request_test.rb
akamai_bookmarklet-0.1.0 vendor/gems/ruby/1.8/gems/sinatra-0.9.4/test/request_test.rb
middleman-0.12.2 lib/middleman/vendor/gems/gems/sinatra-0.9.4/test/request_test.rb
middleman-0.12.1 lib/middleman/vendor/gems/gems/sinatra-0.9.4/test/request_test.rb
middleman-0.12.0.pre3 lib/middleman/vendor/gems/gems/sinatra-0.9.4/test/request_test.rb
middleman-0.12.0.pre2 lib/middleman/vendor/gems/gems/sinatra-0.9.4/test/request_test.rb
middleman-0.12.0.pre lib/middleman/vendor/gems/gems/sinatra-0.9.4/test/request_test.rb
middleman-0.10.17 vendor/gems/gems/sinatra-0.9.4/test/request_test.rb
middleman-0.10.16 vendor/gems/gems/sinatra-0.9.4/test/request_test.rb
middleman-0.10.15 vendor/gems/gems/sinatra-0.9.4/test/request_test.rb
middleman-0.10.14 vendor/gems/gems/sinatra-0.9.4/test/request_test.rb
sinatra-0.9.4 test/request_test.rb