Sha256: e428f894620dd5ca0165e7dfb2b17847de4965faecec8d9b62afe00d681b95ac
Contents?: true
Size: 789 Bytes
Versions: 19
Compression:
Stored size: 789 Bytes
Contents
require File.join(__dir__, '../../rack_helper.rb') describe Jpmobile::MobileCarrier, 'Windows Phone' do include Rack::Test::Methods context '端末種別で' do it 'WindowsPhone を判別できること' do res = Rack::MockRequest.env_for( 'http://jpmobile-rails.org/', 'HTTP_USER_AGENT' => 'Mozilla/4.0 (Compatible; MSIE 6.0; Windows NT 5.1 T-01A_6.5; Windows Phone 6.5)', ) env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1] expect(env['rack.jpmobile'].class).to eq(Jpmobile::Mobile::WindowsPhone) 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