Sha256: ecd0613509219746fe635a2743bd360c1ae9fc6e85d85e46ff04c422963bdc2c

Contents?: true

Size: 886 Bytes

Versions: 61

Compression:

Stored size: 886 Bytes

Contents

# -*- coding: utf-8 -*-
require File.join(File.expand_path(File.dirname(__FILE__)), '../../rack_helper.rb')

describe Jpmobile::Rack::MobileCarrier, "android" do
  include Rack::Test::Methods

  context "端末種別で" do
    it "Android を判別できること" do
      res = Rack::MockRequest.env_for(
        'http://jpmobile-rails.org/',
        'HTTP_USER_AGENT' => 'Mozilla/5.0 (Linux; U; Android 1.6; ja-jp; SonyEriccsonSO-01B Build/R1EA018) AppleWebKit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1')
      env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]

      env['rack.jpmobile'].class.should            == Jpmobile::Mobile::Android
      env['rack.jpmobile'].position.should         be_nil
      env['rack.jpmobile'].smart_phone?.should     be_true
      env['rack.jpmobile'].supports_cookie?.should be_true
    end
  end
end

Version data entries

61 entries across 61 versions & 1 rubygems

Version Path
jpmobile-3.0.1 spec/rack/jpmobile/android_spec.rb
jpmobile-2.0.7 spec/rack/jpmobile/android_spec.rb
jpmobile-2.0.6 spec/rack/jpmobile/android_spec.rb
jpmobile-3.0.0 spec/rack/jpmobile/android_spec.rb
jpmobile-2.0.5 spec/rack/jpmobile/android_spec.rb
jpmobile-1.0.8 spec/rack/jpmobile/android_spec.rb
jpmobile-2.0.4 spec/rack/jpmobile/android_spec.rb
jpmobile-2.0.3 spec/rack/jpmobile/android_spec.rb
jpmobile-1.0.7 spec/rack/jpmobile/android_spec.rb
jpmobile-1.0.6 spec/rack/jpmobile/android_spec.rb
jpmobile-2.0.2 spec/rack/jpmobile/android_spec.rb
jpmobile-2.0.1 spec/rack/jpmobile/android_spec.rb
jpmobile-1.0.5 spec/rack/jpmobile/android_spec.rb
jpmobile-2.0.0 spec/rack/jpmobile/android_spec.rb
jpmobile-1.0.4 spec/rack/jpmobile/android_spec.rb
jpmobile-1.0.3 spec/rack/jpmobile/android_spec.rb
jpmobile-1.0.2 spec/rack/jpmobile/android_spec.rb
jpmobile-1.0.1 spec/rack/jpmobile/android_spec.rb
jpmobile-2.0.0.pre.2 spec/rack/jpmobile/android_spec.rb
jpmobile-2.0.0.pre.1 spec/rack/jpmobile/android_spec.rb