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.7.5 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.7.4 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.7.3 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.7.2 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.7.1 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.7.0 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.6.9 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.6.8 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.6.7 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.6.6 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.6.5 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.6.4 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.6.3 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.6.2 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.6.1 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.6.0 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.5.17 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.5.16 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.5.15 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb
classiccms-0.5.14 vendor/bundle/gems/sinatra-support-1.2.2/test/test_useragent_app.rb