Sha256: 3464a2eead801384ab0506ae6e5a903c66d594ad630dd94a26afd17e1d829c07

Contents?: true

Size: 571 Bytes

Versions: 35

Compression:

Stored size: 571 Bytes

Contents

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

describe 'Sinatra::Request' do
  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

35 entries across 35 versions & 9 rubygems

Version Path
sinatra-sinatra-0.9.0.4 test/request_test.rb
sinatra-sinatra-0.9.0.5 test/request_test.rb
sinatra-sinatra-0.9.0 test/request_test.rb
sinatra-sinatra-0.9.1.1 test/request_test.rb
sinatra-sinatra-0.9.1.2 test/request_test.rb
sinatra-sinatra-0.9.1 test/request_test.rb
nbudin-castronaut-0.7.5 vendor/sinatra/test/request_test.rb
sinatra-0.9.1.1 test/request_test.rb
sinatra-0.9.0.1 test/request_test.rb
sinatra-0.9.0.3 test/request_test.rb
sinatra-0.9.1 test/request_test.rb
sinatra-0.9.0.5 test/request_test.rb
sinatra-0.9.0.4 test/request_test.rb
sinatra-0.9.0.2 test/request_test.rb
sinatra-0.9.0 test/request_test.rb