Sha256: 0630e3bb34a00c67b0f6515b1641730521ce394246c68dc6c9cd380395ef86e9

Contents?: true

Size: 814 Bytes

Versions: 3

Compression:

Stored size: 814 Bytes

Contents

require File.join(File.expand_path(File.dirname(__FILE__)), '../../rack_helper.rb')

describe Jpmobile::MobileCarrier, 'Windows Phone' do
  include Rack::Test::Methods

  context '端末種別で' do
    it 'BlackBerryを判別できること' do
      res = Rack::MockRequest.env_for(
        'http://jpmobile-rails.org/',
        'HTTP_USER_AGENT' => 'BlackBerry9000/4.6.0.224 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/220'
      )
      env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]

      expect(env['rack.jpmobile'].class).to            eq(Jpmobile::Mobile::BlackBerry)
      expect(env['rack.jpmobile'].position).to         be_nil
      expect(env['rack.jpmobile'].smart_phone?).to     be_truthy
      expect(env['rack.jpmobile'].supports_cookie?).to be_truthy
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jpmobile-5.0.1 spec/rack/jpmobile/black_berry_spec.rb
jpmobile-5.1.1 spec/rack/jpmobile/black_berry_spec.rb
jpmobile-5.1.0 spec/rack/jpmobile/black_berry_spec.rb