Sha256: 1681848c91e332fb236c33f262c07bd843da9f6ded1f8187f76d104771f888f3

Contents?: true

Size: 626 Bytes

Versions: 50

Compression:

Stored size: 626 Bytes

Contents

require File.expand_path('../helper', __FILE__)

Encoding.default_external = 'utf-8'

class UserAgentAppTest < Test::Unit::TestCase
  include Rack::Test::Methods

  class App < Sinatra::Base
    helpers Sinatra::UserAgentHelpers
    get('/class') { "<body class='#{browser.body_class}'>" }
  end

  UA_CHROME = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.68 Safari/534.24"

  def app
    App.new
  end

  test "boogie" do
    header 'User-Agent', UA_CHROME
    get '/class'

    assert_equal "<body class='webkit chrome osx mac'>", last_response.body.strip
  end
end

Version data entries

50 entries across 50 versions & 2 rubygems

Version Path
classiccms-0.5.13 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.5.12 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.5.11 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.5.10 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.5.9 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.5.8 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.5.7 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.5.6 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.5.5 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.5.2 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.5.1 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.5.0 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.4.2 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.4.1 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.4.0 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.3.9 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.3.8 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.3.7 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.3.6 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.3.5 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb