Sha256: 193a339207b0d391227e7277ca5fced8772c9e5674313e88b1507a42eb64eb21

Contents?: true

Size: 846 Bytes

Versions: 19

Compression:

Stored size: 846 Bytes

Contents

require File.join(__dir__, '../../rack_helper.rb')

describe Jpmobile::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::MobileCarrier.new(UnitApplication.new).call(res)[1]

      expect(env['rack.jpmobile'].class).to            eq(Jpmobile::Mobile::Android)
      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

19 entries across 19 versions & 1 rubygems

Version Path
jpmobile-8.0.0 spec/rack/jpmobile/android_spec.rb
jpmobile-7.2.0 spec/rack/jpmobile/android_spec.rb
jpmobile-7.1.0 spec/rack/jpmobile/android_spec.rb
jpmobile-7.0.4 spec/rack/jpmobile/android_spec.rb
jpmobile-7.0.3 spec/rack/jpmobile/android_spec.rb
jpmobile-7.0.2 spec/rack/jpmobile/android_spec.rb
jpmobile-7.0.1 spec/rack/jpmobile/android_spec.rb
jpmobile-7.0.0 spec/rack/jpmobile/android_spec.rb
jpmobile-6.1.2 spec/rack/jpmobile/android_spec.rb
jpmobile-6.1.1 spec/rack/jpmobile/android_spec.rb
jpmobile-6.1.0 spec/rack/jpmobile/android_spec.rb
jpmobile-6.0.0 spec/rack/jpmobile/android_spec.rb
jpmobile-5.2.5 spec/rack/jpmobile/android_spec.rb
jpmobile-6.0.0.beta spec/rack/jpmobile/android_spec.rb
jpmobile-5.2.4 spec/rack/jpmobile/android_spec.rb
jpmobile-5.2.3 spec/rack/jpmobile/android_spec.rb
jpmobile-5.2.2 spec/rack/jpmobile/android_spec.rb
jpmobile-5.2.1 spec/rack/jpmobile/android_spec.rb
jpmobile-5.2.0 spec/rack/jpmobile/android_spec.rb