jpmobile 4.2.5 → 5.0.0.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -2
- data/jpmobile.gemspec +1 -2
- data/lib/jpmobile.rb +17 -7
- data/lib/jpmobile/configuration.rb +1 -1
- data/lib/jpmobile/encoding.rb +13 -19
- data/lib/jpmobile/{hook_action_controller.rb → fallback_view_selector.rb} +4 -6
- data/lib/jpmobile/filter.rb +13 -10
- data/lib/jpmobile/mobile/abstract_mobile.rb +2 -2
- data/lib/jpmobile/mobile/google_emoticon.rb +2 -2
- data/lib/jpmobile/mobile/smart_phone.rb +2 -2
- data/lib/jpmobile/mobile/unicode_emoticon.rb +2 -2
- data/lib/jpmobile/rack/filter.rb +36 -38
- data/lib/jpmobile/rack/mobile_carrier.rb +8 -10
- data/lib/jpmobile/rack/params_filter.rb +32 -34
- data/lib/jpmobile/rails.rb +17 -4
- data/lib/jpmobile/resolver.rb +2 -3
- data/lib/jpmobile/trans_sid.rb +58 -78
- data/lib/jpmobile/util.rb +0 -17
- data/lib/jpmobile/version.rb +1 -1
- data/lib/tasks/jpmobile_tasks.rake +31 -37
- data/spec/rack/jpmobile/android_spec.rb +2 -2
- data/spec/rack/jpmobile/au_spec.rb +17 -17
- data/spec/rack/jpmobile/black_berry_spec.rb +2 -2
- data/spec/rack/jpmobile/docomo_spec.rb +15 -15
- data/spec/rack/jpmobile/emoticon_spec.rb +57 -57
- data/spec/rack/jpmobile/filter_spec.rb +25 -25
- data/spec/rack/jpmobile/iphone_spec.rb +3 -3
- data/spec/rack/jpmobile/mobile_by_ua_spec.rb +3 -3
- data/spec/rack/jpmobile/params_filter_spec.rb +10 -10
- data/spec/rack/jpmobile/softbank_spec.rb +9 -9
- data/spec/rack/jpmobile/willcom_spec.rb +6 -6
- data/spec/rack/jpmobile/windows_phone.rb +2 -2
- data/spec/rack_helper.rb +0 -1
- data/spec/unit/mail_spec.rb +1 -10
- data/spec/unit/util_spec.rb +42 -56
- data/test/rails/overrides/Gemfile.jpmobile +5 -3
- data/test/rails/overrides/app/controllers/filter_controller.rb +0 -1
- data/test/rails/overrides/app/controllers/filter_controller_base.rb +14 -9
- data/test/rails/overrides/app/controllers/hankaku_input_filter_controller.rb +2 -2
- data/test/rails/overrides/app/controllers/trans_sid_metal_controller.rb +0 -1
- data/test/rails/overrides/app/views/filter/text_template.html.erb +1 -0
- data/test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb +3 -3
- data/test/rails/overrides/spec/controllers/trans_sid_controller_spec.rb +2 -2
- data/test/rails/overrides/spec/features/filter_spec.rb +10 -9
- data/test/rails/overrides/spec/helpers/helpers_spec.rb +5 -3
- data/test/rails/overrides/spec/requests/docomo_spec.rb +6 -6
- data/test/rails/overrides/spec/requests/emobile_spec.rb +6 -6
- data/test/rails/overrides/spec/requests/pc_spec.rb +3 -3
- data/test/rails/overrides/spec/requests/softbank_emulator_spec.rb +4 -4
- data/test/rails/overrides/spec/requests/template_path_spec.rb +1 -1
- data/test/rails/overrides/spec/requests/trans_sid_spec.rb +7 -9
- metadata +12 -28
- data/lib/jpmobile/hook_action_dispatch.rb +0 -2
- data/lib/jpmobile/rack.rb +0 -14
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
require File.join(File.expand_path(File.dirname(__FILE__)), '../../rack_helper.rb')
|
3
3
|
|
4
|
-
describe Jpmobile::
|
4
|
+
describe Jpmobile::MobileCarrier, "Windows Phone" do
|
5
5
|
include Rack::Test::Methods
|
6
6
|
|
7
7
|
context "端末種別で" do
|
@@ -9,7 +9,7 @@ describe Jpmobile::Rack::MobileCarrier, "Windows Phone" do
|
|
9
9
|
res = Rack::MockRequest.env_for(
|
10
10
|
'http://jpmobile-rails.org/',
|
11
11
|
'HTTP_USER_AGENT' => 'BlackBerry9000/4.6.0.224 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/220')
|
12
|
-
env = Jpmobile::
|
12
|
+
env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
13
13
|
|
14
14
|
expect(env['rack.jpmobile'].class).to eq(Jpmobile::Mobile::BlackBerry)
|
15
15
|
expect(env['rack.jpmobile'].position).to be_nil
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
require File.join(File.expand_path(File.dirname(__FILE__)), '../../rack_helper.rb')
|
3
3
|
|
4
|
-
describe Jpmobile::
|
4
|
+
describe Jpmobile::MobileCarrier, "docomo" do
|
5
5
|
include Rack::Test::Methods
|
6
6
|
|
7
7
|
context "SH902i のとき" do
|
@@ -9,7 +9,7 @@ describe Jpmobile::Rack::MobileCarrier, "docomo" do
|
|
9
9
|
res = Rack::MockRequest.env_for(
|
10
10
|
'http://jpmobile-rails.org/',
|
11
11
|
'HTTP_USER_AGENT' => 'DoCoMo/2.0 SH902i(c100;TB;W24H16)')
|
12
|
-
@env = Jpmobile::
|
12
|
+
@env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
13
13
|
end
|
14
14
|
|
15
15
|
it "Jpmobile::Mobile::Docomo のインスタンスが env['rack.mobile'] にあること" do
|
@@ -40,7 +40,7 @@ describe Jpmobile::Rack::MobileCarrier, "docomo" do
|
|
40
40
|
res = Rack::MockRequest.env_for(
|
41
41
|
'http://jpmobile-rails.org/',
|
42
42
|
'HTTP_USER_AGENT' => "DoCoMo/1.0/SO506iC/c20/TB/W20H10")
|
43
|
-
@env = Jpmobile::
|
43
|
+
@env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
44
44
|
end
|
45
45
|
|
46
46
|
it "Jpmobile::Mobile::Docomo のインスタンスが env['rack.mobile'] にあること" do
|
@@ -71,7 +71,7 @@ describe Jpmobile::Rack::MobileCarrier, "docomo" do
|
|
71
71
|
res = Rack::MockRequest.env_for(
|
72
72
|
'http://jpmobile-rails.org/',
|
73
73
|
'HTTP_USER_AGENT' => "DoCoMo/2.0 P09A3(c500;TB;W20H12)")
|
74
|
-
@env = Jpmobile::
|
74
|
+
@env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
75
75
|
end
|
76
76
|
|
77
77
|
it "#supports_cookie? が true になること" do
|
@@ -88,7 +88,7 @@ describe Jpmobile::Rack::MobileCarrier, "docomo" do
|
|
88
88
|
res = Rack::MockRequest.env_for(
|
89
89
|
'http://jpmobile-rails.org/',
|
90
90
|
'HTTP_USER_AGENT' => "DoCoMo/2.0 P07A3(c500;TB;W24H15)")
|
91
|
-
@env = Jpmobile::
|
91
|
+
@env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
92
92
|
end
|
93
93
|
|
94
94
|
it "#supports_cookie? が true になること" do
|
@@ -105,7 +105,7 @@ describe Jpmobile::Rack::MobileCarrier, "docomo" do
|
|
105
105
|
res = Rack::MockRequest.env_for(
|
106
106
|
'http://jpmobile-rails.org/',
|
107
107
|
'HTTP_USER_AGENT' => "DoCoMo/2.0 L01B(c500;TB;W40H10)")
|
108
|
-
@env = Jpmobile::
|
108
|
+
@env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
109
109
|
end
|
110
110
|
|
111
111
|
it "#supports_cookie? が true になること" do
|
@@ -123,7 +123,7 @@ describe Jpmobile::Rack::MobileCarrier, "docomo" do
|
|
123
123
|
'http://jpmobile-rails.org/',
|
124
124
|
'HTTP_USER_AGENT' => "DoCoMo/1.0/SO506iC/c20/TB/W20H10",
|
125
125
|
"QUERY_STRING" => "AREACODE=00100&ACTN=OK")
|
126
|
-
env = Jpmobile::
|
126
|
+
env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
127
127
|
|
128
128
|
expect(env['rack.jpmobile'].areacode).to eq("00100")
|
129
129
|
end
|
@@ -133,7 +133,7 @@ describe Jpmobile::Rack::MobileCarrier, "docomo" do
|
|
133
133
|
'http://jpmobile-rails.org/',
|
134
134
|
'HTTP_USER_AGENT' => "DoCoMo/1.0/SO506iC/c20/TB/W20H10",
|
135
135
|
"QUERY_STRING" => "LAT=%2B35.00.35.600&LON=%2B135.41.35.600&GEO=wgs84&POSINFO=2&AREACODE=00100&ACTN=OK")
|
136
|
-
env = Jpmobile::
|
136
|
+
env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
137
137
|
|
138
138
|
expect(env['rack.jpmobile'].areacode).to eq("00100")
|
139
139
|
|
@@ -148,7 +148,7 @@ describe Jpmobile::Rack::MobileCarrier, "docomo" do
|
|
148
148
|
'http://jpmobile-rails.org/',
|
149
149
|
'HTTP_USER_AGENT' => "DoCoMo/2.0 SA702i(c100;TB;W30H15)",
|
150
150
|
"QUERY_STRING" => "lat=%2B35.00.35.600&lon=%2B135.41.35.600&geo=wgs84&x-acc=3")
|
151
|
-
env = Jpmobile::
|
151
|
+
env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
152
152
|
|
153
153
|
expect(env['rack.jpmobile'].position.lat).to be_within(1e-7).of(35.00988889)
|
154
154
|
expect(env['rack.jpmobile'].position.lon).to be_within(1e-7).of(135.6932222)
|
@@ -162,7 +162,7 @@ describe Jpmobile::Rack::MobileCarrier, "docomo" do
|
|
162
162
|
'http://jpmobile-rails.org/',
|
163
163
|
'HTTP_USER_AGENT' => "DoCoMo/2.0 SH903i(c100;TB;W24H16)",
|
164
164
|
"QUERY_STRING" => "lat=%2B35.00.35.600&lon=%2B135.41.35.600&geo=WGS84&alt=%2B64.000&x-acc=1")
|
165
|
-
env = Jpmobile::
|
165
|
+
env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
166
166
|
|
167
167
|
expect(env['rack.jpmobile'].position.lat).to be_within(1e-7).of(35.00988889)
|
168
168
|
expect(env['rack.jpmobile'].position.lon).to be_within(1e-7).of(135.6932222)
|
@@ -174,7 +174,7 @@ describe Jpmobile::Rack::MobileCarrier, "docomo" do
|
|
174
174
|
res = Rack::MockRequest.env_for(
|
175
175
|
'http://jpmobile-rails.org/',
|
176
176
|
'HTTP_USER_AGENT' => "DoCoMo/1.0/SO505iS/c20/TC/W30H16/serXXXXX000000")
|
177
|
-
env = Jpmobile::
|
177
|
+
env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
178
178
|
|
179
179
|
expect(env['rack.jpmobile'].serial_number).to eq("XXXXX000000")
|
180
180
|
expect(env['rack.jpmobile'].ident).to eq("XXXXX000000")
|
@@ -187,7 +187,7 @@ describe Jpmobile::Rack::MobileCarrier, "docomo" do
|
|
187
187
|
res = Rack::MockRequest.env_for(
|
188
188
|
'http://jpmobile-rails.org/',
|
189
189
|
'HTTP_USER_AGENT' => "DoCoMo/2.0 D902i(c100;TB;W23H16;ser999999999999999;icc0000000000000000000f)")
|
190
|
-
env = Jpmobile::
|
190
|
+
env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
191
191
|
|
192
192
|
expect(env['rack.jpmobile'].serial_number).to eq("999999999999999")
|
193
193
|
expect(env['rack.jpmobile'].icc).to eq("0000000000000000000f")
|
@@ -203,7 +203,7 @@ describe Jpmobile::Rack::MobileCarrier, "docomo" do
|
|
203
203
|
'http://jpmobile-rails.org/',
|
204
204
|
'HTTP_USER_AGENT' => "DoCoMo/2.0 SH902i(c100;TB;W24H12)",
|
205
205
|
"REMOTE_ADDR" => "210.153.84.1")
|
206
|
-
env = Jpmobile::
|
206
|
+
env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
207
207
|
|
208
208
|
expect(env['rack.jpmobile'].valid_ip?).to be_truthy
|
209
209
|
end
|
@@ -213,7 +213,7 @@ describe Jpmobile::Rack::MobileCarrier, "docomo" do
|
|
213
213
|
'http://jpmobile-rails.org/',
|
214
214
|
'HTTP_USER_AGENT' => "DoCoMo/2.0 SH902i(c100;TB;W24H12)",
|
215
215
|
"REMOTE_ADDR" => "127.0.0.1")
|
216
|
-
env = Jpmobile::
|
216
|
+
env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
217
217
|
|
218
218
|
expect(env['rack.jpmobile'].valid_ip?).to be_falsey
|
219
219
|
end
|
@@ -224,7 +224,7 @@ describe Jpmobile::Rack::MobileCarrier, "docomo" do
|
|
224
224
|
res = Rack::MockRequest.env_for(
|
225
225
|
'http://jpmobile-rails.org/',
|
226
226
|
'HTTP_USER_AGENT' => "DoCoMo/1.0/SO506iC/c20/TB/W20H10")
|
227
|
-
env = Jpmobile::
|
227
|
+
env = Jpmobile::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
228
228
|
|
229
229
|
expect(env['rack.jpmobile'].display.browser_width).to eq(240)
|
230
230
|
expect(env['rack.jpmobile'].display.browser_height).to eq(256)
|
@@ -29,23 +29,23 @@ describe "絵文字が" do
|
|
29
29
|
end
|
30
30
|
|
31
31
|
it "docomo 絵文字が変換されないこと" do
|
32
|
-
response = Jpmobile::
|
32
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@docomo_cr))).call(@res)[2]
|
33
33
|
expect(response_body(response)).to eq(@docomo_cr)
|
34
|
-
response = Jpmobile::
|
34
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@docomo_utf8))).call(@res)[2]
|
35
35
|
expect(response_body(response)).to eq(@docomo_utf8)
|
36
36
|
end
|
37
37
|
|
38
38
|
it "au 絵文字が変換されないこと" do
|
39
|
-
response = Jpmobile::
|
39
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@au_cr))).call(@res)[2]
|
40
40
|
expect(response_body(response)).to eq(@au_cr)
|
41
|
-
response = Jpmobile::
|
41
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@au_utf8))).call(@res)[2]
|
42
42
|
expect(response_body(response)).to eq(@au_utf8)
|
43
43
|
end
|
44
44
|
|
45
45
|
it "softbank 絵文字が変換されないこと" do
|
46
|
-
response = Jpmobile::
|
46
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@softbank_cr))).call(@res)[2]
|
47
47
|
expect(response_body(response)).to eq(@softbank_cr)
|
48
|
-
response = Jpmobile::
|
48
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@softbank_utf8))).call(@res)[2]
|
49
49
|
expect(response_body(response)).to eq(@softbank_utf8)
|
50
50
|
end
|
51
51
|
end
|
@@ -73,38 +73,38 @@ describe "絵文字が" do
|
|
73
73
|
end
|
74
74
|
|
75
75
|
it "docomo 絵文字が画像に変換されること" do
|
76
|
-
response = Jpmobile::
|
76
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@docomo_cr))).call(@res)[2]
|
77
77
|
expect(response_body(response)).to eq("<img src=\"#{@path}/sun.gif\" alt=\"sun\" />")
|
78
78
|
end
|
79
79
|
|
80
80
|
it "docomo 絵文字コードが画像に変換されること" do
|
81
|
-
response = Jpmobile::
|
81
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@docomo_utf8))).call(@res)[2]
|
82
82
|
expect(response_body(response)).to eq("<img src=\"#{@path}/sun.gif\" alt=\"sun\" />")
|
83
83
|
end
|
84
84
|
|
85
85
|
it "au 絵文字が画像に変換されること" do
|
86
|
-
response = Jpmobile::
|
86
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@au_cr))).call(@res)[2]
|
87
87
|
expect(response_body(response)).to eq("<img src=\"#{@path}/sun.gif\" alt=\"sun\" />")
|
88
88
|
end
|
89
89
|
|
90
90
|
it "au 絵文字コードが画像に変換されること" do
|
91
|
-
response = Jpmobile::
|
91
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@au_utf8))).call(@res)[2]
|
92
92
|
expect(response_body(response)).to eq("<img src=\"#{@path}/sun.gif\" alt=\"sun\" />")
|
93
93
|
end
|
94
94
|
|
95
95
|
it "softbank 絵文字が画像に変換されること" do
|
96
|
-
response = Jpmobile::
|
96
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@softbank_cr))).call(@res)[2]
|
97
97
|
expect(response_body(response)).to eq("<img src=\"#{@path}/sun.gif\" alt=\"sun\" />")
|
98
98
|
end
|
99
99
|
|
100
100
|
it "softbank 絵文字コードが画像に変換されること" do
|
101
|
-
response = Jpmobile::
|
101
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@softbank_utf8))).call(@res)[2]
|
102
102
|
expect(response_body(response)).to eq("<img src=\"#{@path}/sun.gif\" alt=\"sun\" />")
|
103
103
|
end
|
104
104
|
|
105
105
|
it "Content-Type が変換できないものである場合には変換しないこと" do
|
106
106
|
@res = Rack::MockRequest.env_for("/", 'Content-Type' => 'image/jpeg')
|
107
|
-
response = Jpmobile::
|
107
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@softbank_utf8))).call(@res)[2]
|
108
108
|
expect(response_body(response)).to eq(@softbank_utf8)
|
109
109
|
end
|
110
110
|
end
|
@@ -118,26 +118,26 @@ describe "絵文字が" do
|
|
118
118
|
end
|
119
119
|
|
120
120
|
it "docomo 絵文字が変換されること" do
|
121
|
-
response = Jpmobile::
|
121
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@docomo_cr))).call(@res)[2]
|
122
122
|
expect(response_body(response)).to eq(sjis("\xf8\x9f"))
|
123
|
-
response = Jpmobile::
|
123
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@docomo_utf8))).call(@res)[2]
|
124
124
|
expect(response_body(response)).to eq(sjis("\xf8\x9f"))
|
125
125
|
|
126
|
-
response = Jpmobile::
|
126
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@docomo_docomopoint))).call(@res)[2]
|
127
127
|
expect(response_body(response)).to eq(sjis("\xf9\x79"))
|
128
128
|
end
|
129
129
|
|
130
130
|
it "au 絵文字が変換されること" do
|
131
|
-
response = Jpmobile::
|
131
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@au_cr))).call(@res)[2]
|
132
132
|
expect(response_body(response)).to eq(sjis("\xf8\x9f"))
|
133
|
-
response = Jpmobile::
|
133
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@au_utf8))).call(@res)[2]
|
134
134
|
expect(response_body(response)).to eq(sjis("\xf8\x9f"))
|
135
135
|
end
|
136
136
|
|
137
137
|
it "softbank 絵文字が変換されること" do
|
138
|
-
response = Jpmobile::
|
138
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@softbank_cr))).call(@res)[2]
|
139
139
|
expect(response_body(response)).to eq(sjis("\xf8\x9f"))
|
140
|
-
response = Jpmobile::
|
140
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@softbank_utf8))).call(@res)[2]
|
141
141
|
expect(response_body(response)).to eq(sjis("\xf8\x9f"))
|
142
142
|
end
|
143
143
|
|
@@ -149,7 +149,7 @@ describe "絵文字が" do
|
|
149
149
|
"REQUEST_METHOD" => "GET",
|
150
150
|
'HTTP_USER_AGENT' => 'DoCoMo/2.0 SH906i(c100;TB;W24H16)',
|
151
151
|
'Content-Type' => 'text/html; charset=utf-8')
|
152
|
-
res = Jpmobile::
|
152
|
+
res = Jpmobile::MobileCarrier.new(Jpmobile::ParamsFilter.new(Jpmobile::Filter.new(RenderParamApp.new))).call(res)
|
153
153
|
req = Rack::Request.new(res[1])
|
154
154
|
expect(req.params['q']).to eq(utf8("\xee\x98\xbe"))
|
155
155
|
expect(response_body(res)).to eq(sjis("\xf8\x9f"))
|
@@ -165,26 +165,26 @@ describe "絵文字が" do
|
|
165
165
|
end
|
166
166
|
|
167
167
|
it "docomo 絵文字が変換されること" do
|
168
|
-
response = Jpmobile::
|
168
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@docomo_cr))).call(@res)[2]
|
169
169
|
expect(response_body(response)).to eq(sjis("\xf6\x60"))
|
170
|
-
response = Jpmobile::
|
170
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@docomo_utf8))).call(@res)[2]
|
171
171
|
expect(response_body(response)).to eq(sjis("\xf6\x60"))
|
172
172
|
|
173
|
-
response = Jpmobile::
|
173
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@docomo_docomopoint))).call(@res)[2]
|
174
174
|
expect(response_body(response)).to eq(utf8_to_sjis("[ドコモポイント]"))
|
175
175
|
end
|
176
176
|
|
177
177
|
it "au 絵文字が変換されること" do
|
178
|
-
response = Jpmobile::
|
178
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@au_cr))).call(@res)[2]
|
179
179
|
expect(response_body(response)).to eq(sjis("\xf6\x60"))
|
180
|
-
response = Jpmobile::
|
180
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@au_utf8))).call(@res)[2]
|
181
181
|
expect(response_body(response)).to eq(sjis("\xf6\x60"))
|
182
182
|
end
|
183
183
|
|
184
184
|
it "softbank 絵文字が変換されること" do
|
185
|
-
response = Jpmobile::
|
185
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@softbank_cr))).call(@res)[2]
|
186
186
|
expect(response_body(response)).to eq(sjis("\xf6\x60"))
|
187
|
-
response = Jpmobile::
|
187
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@softbank_utf8))).call(@res)[2]
|
188
188
|
expect(response_body(response)).to eq(sjis("\xf6\x60"))
|
189
189
|
end
|
190
190
|
|
@@ -196,7 +196,7 @@ describe "絵文字が" do
|
|
196
196
|
"REQUEST_METHOD" => "GET",
|
197
197
|
'HTTP_USER_AGENT' => "KDDI-CA32 UP.Browser/6.2.0.7.3.129 (GUI) MMP/2.0",
|
198
198
|
'Content-Type' => 'text/html; charset=utf-8')
|
199
|
-
res = Jpmobile::
|
199
|
+
res = Jpmobile::MobileCarrier.new(Jpmobile::ParamsFilter.new(Jpmobile::Filter.new(RenderParamApp.new))).call(res)
|
200
200
|
req = Rack::Request.new(res[1])
|
201
201
|
expect(req.params['q']).to eq([0xe488].pack("U"))
|
202
202
|
expect(response_body(res)).to eq(sjis("\xf6\x60"))
|
@@ -212,26 +212,26 @@ describe "絵文字が" do
|
|
212
212
|
end
|
213
213
|
|
214
214
|
it "docomo 絵文字が変換されること" do
|
215
|
-
response = Jpmobile::
|
215
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@docomo_cr))).call(@res)[2]
|
216
216
|
expect(response_body(response)).to eq([0xe04a].pack('U'))
|
217
|
-
response = Jpmobile::
|
217
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@docomo_utf8))).call(@res)[2]
|
218
218
|
expect(response_body(response)).to eq([0xe04a].pack('U'))
|
219
219
|
|
220
|
-
response = Jpmobile::
|
220
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@docomo_docomopoint))).call(@res)[2]
|
221
221
|
expect(response_body(response)).to eq("[ドコモポイント]")
|
222
222
|
end
|
223
223
|
|
224
224
|
it "au 絵文字が変換されること" do
|
225
|
-
response = Jpmobile::
|
225
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@au_cr))).call(@res)[2]
|
226
226
|
expect(response_body(response)).to eq([0xe04a].pack('U'))
|
227
|
-
response = Jpmobile::
|
227
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@au_utf8))).call(@res)[2]
|
228
228
|
expect(response_body(response)).to eq([0xe04a].pack('U'))
|
229
229
|
end
|
230
230
|
|
231
231
|
it "softbank 絵文字が変換されること" do
|
232
|
-
response = Jpmobile::
|
232
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@softbank_cr))).call(@res)[2]
|
233
233
|
expect(response_body(response)).to eq([0xe04a].pack('U'))
|
234
|
-
response = Jpmobile::
|
234
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@softbank_utf8))).call(@res)[2]
|
235
235
|
expect(response_body(response)).to eq([0xe04a].pack('U'))
|
236
236
|
end
|
237
237
|
|
@@ -243,7 +243,7 @@ describe "絵文字が" do
|
|
243
243
|
"REQUEST_METHOD" => "GET",
|
244
244
|
'HTTP_USER_AGENT' => "SoftBank/1.0/910T/TJ001/SN000000000000000 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1",
|
245
245
|
'Content-Type' => 'text/html; charset=utf-8')
|
246
|
-
res = Jpmobile::
|
246
|
+
res = Jpmobile::MobileCarrier.new(Jpmobile::ParamsFilter.new(Jpmobile::Filter.new(RenderParamApp.new))).call(res)
|
247
247
|
req = Rack::Request.new(res[1])
|
248
248
|
expect(req.params['q']).to eq([0xf04a].pack("U"))
|
249
249
|
expect(response_body(res)).to eq([0xe04a].pack('U'))
|
@@ -259,9 +259,9 @@ describe "絵文字が" do
|
|
259
259
|
end
|
260
260
|
|
261
261
|
it "softbank 絵文字が変換されること" do
|
262
|
-
response = Jpmobile::
|
262
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@softbank_cr))).call(@res)[2]
|
263
263
|
expect(response_body(response)).to eq([0xe04a].pack('U'))
|
264
|
-
response = Jpmobile::
|
264
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@softbank_utf8))).call(@res)[2]
|
265
265
|
expect(response_body(response)).to eq([0xe04a].pack('U'))
|
266
266
|
end
|
267
267
|
|
@@ -273,7 +273,7 @@ describe "絵文字が" do
|
|
273
273
|
"REQUEST_METHOD" => "GET",
|
274
274
|
'HTTP_USER_AGENT' => "Vodafone/1.0/V705SH/SHJ001/SN000000000000000 Browser/VF-NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1",
|
275
275
|
'Content-Type' => 'text/html; charset=utf-8')
|
276
|
-
res = Jpmobile::
|
276
|
+
res = Jpmobile::MobileCarrier.new(Jpmobile::ParamsFilter.new(Jpmobile::Filter.new(RenderParamApp.new))).call(res)
|
277
277
|
req = Rack::Request.new(res[1])
|
278
278
|
expect(req.params['q']).to eq([0xf04a].pack("U"))
|
279
279
|
expect(response_body(res)).to eq([0xe04a].pack('U'))
|
@@ -290,9 +290,9 @@ describe "絵文字が" do
|
|
290
290
|
end
|
291
291
|
|
292
292
|
it 'should convert Softbank emoticon' do
|
293
|
-
response = Jpmobile::
|
293
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@softbank_cr))).call(@res)[2]
|
294
294
|
expect(response_body(response)).to eq([0xe04a].pack('U'))
|
295
|
-
response = Jpmobile::
|
295
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@softbank_utf8))).call(@res)[2]
|
296
296
|
expect(response_body(response)).to eq([0xe04a].pack('U'))
|
297
297
|
end
|
298
298
|
|
@@ -304,14 +304,14 @@ describe "絵文字が" do
|
|
304
304
|
"REQUEST_METHOD" => "GET",
|
305
305
|
'HTTP_USER_AGENT' => "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0_1 like Mac OS X; ja-jp) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A306 Safari/6531.22.7",
|
306
306
|
'Content-Type' => 'text/html; charset=utf-8')
|
307
|
-
res = Jpmobile::
|
307
|
+
res = Jpmobile::MobileCarrier.new(Jpmobile::ParamsFilter.new(Jpmobile::Filter.new(RenderParamApp.new))).call(res)
|
308
308
|
req = Rack::Request.new(res[1])
|
309
309
|
expect(req.params['q']).to eq([0xf04a].pack("U"))
|
310
310
|
expect(response_body(res)).to eq([0xe04a].pack('U'))
|
311
311
|
end
|
312
312
|
|
313
313
|
it 'should not convert 〓' do
|
314
|
-
response = Jpmobile::
|
314
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new('〓'))).call(@res)[2]
|
315
315
|
expect(response_body(response)).to eq('〓')
|
316
316
|
end
|
317
317
|
end
|
@@ -327,9 +327,9 @@ describe "絵文字が" do
|
|
327
327
|
end
|
328
328
|
|
329
329
|
it "should convert Unicode emoticon" do
|
330
|
-
response = Jpmobile::
|
330
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@unicode_single))).call(@res)[2]
|
331
331
|
expect(response_body(response)).to eq([0x2600].pack('U*'))
|
332
|
-
response = Jpmobile::
|
332
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@unicode_multi))).call(@res)[2]
|
333
333
|
expect(response_body(response)).to eq([0x26C5].pack('U*'))
|
334
334
|
end
|
335
335
|
|
@@ -341,14 +341,14 @@ describe "絵文字が" do
|
|
341
341
|
"REQUEST_METHOD" => "GET",
|
342
342
|
'HTTP_USER_AGENT' => "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0_1 like Mac OS X; ja-jp) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A306 Safari/6531.22.7",
|
343
343
|
'Content-Type' => 'text/html; charset=utf-8')
|
344
|
-
res = Jpmobile::
|
344
|
+
res = Jpmobile::MobileCarrier.new(Jpmobile::ParamsFilter.new(Jpmobile::Filter.new(RenderParamApp.new))).call(res)
|
345
345
|
req = Rack::Request.new(res[1])
|
346
346
|
expect(req.params['q']).to eq([0x26C5].pack("U"))
|
347
347
|
expect(response_body(res)).to eq([0x26C5].pack('U'))
|
348
348
|
end
|
349
349
|
|
350
350
|
it 'should not convert 〓' do
|
351
|
-
response = Jpmobile::
|
351
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new('〓'))).call(@res)[2]
|
352
352
|
expect(response_body(response)).to eq('〓')
|
353
353
|
end
|
354
354
|
end
|
@@ -369,9 +369,9 @@ describe "絵文字が" do
|
|
369
369
|
end
|
370
370
|
|
371
371
|
it "should convert Google emoticon" do
|
372
|
-
response = Jpmobile::
|
372
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@google_single))).call(@res)[2]
|
373
373
|
expect(response_body(response)).to eq([0xFE000].pack('U*'))
|
374
|
-
response = Jpmobile::
|
374
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@google_multi))).call(@res)[2]
|
375
375
|
expect(response_body(response)).to eq([0xFE00F].pack('U*'))
|
376
376
|
end
|
377
377
|
|
@@ -383,14 +383,14 @@ describe "絵文字が" do
|
|
383
383
|
"REQUEST_METHOD" => "GET",
|
384
384
|
'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',
|
385
385
|
'Content-Type' => 'text/html; charset=utf-8')
|
386
|
-
res = Jpmobile::
|
386
|
+
res = Jpmobile::MobileCarrier.new(Jpmobile::ParamsFilter.new(Jpmobile::Filter.new(RenderParamApp.new))).call(res)
|
387
387
|
req = Rack::Request.new(res[1])
|
388
388
|
expect(req.params['q']).to eq([0xe63e, 0xe63f].pack("U*"))
|
389
389
|
expect(response_body(res)).to eq([0xfe000, 0xfe001].pack("U*"))
|
390
390
|
end
|
391
391
|
|
392
392
|
it 'should not convert 〓' do
|
393
|
-
response = Jpmobile::
|
393
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new('〓'))).call(@res)[2]
|
394
394
|
expect(response_body(response)).to eq('〓')
|
395
395
|
end
|
396
396
|
end
|
@@ -404,9 +404,9 @@ describe "絵文字が" do
|
|
404
404
|
end
|
405
405
|
|
406
406
|
it "should convert Google emoticon" do
|
407
|
-
response = Jpmobile::
|
407
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@google_single))).call(@res)[2]
|
408
408
|
expect(response_body(response)).to eq([0xFE000].pack('U*'))
|
409
|
-
response = Jpmobile::
|
409
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new(@google_multi))).call(@res)[2]
|
410
410
|
expect(response_body(response)).to eq([0xFE00F].pack('U*'))
|
411
411
|
end
|
412
412
|
|
@@ -418,14 +418,14 @@ describe "絵文字が" do
|
|
418
418
|
"REQUEST_METHOD" => "GET",
|
419
419
|
'HTTP_USER_AGENT' => 'Mozilla/5.0 (Linux; U; Android 2.2; ja-jp; SC-01C Build/FROYO) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1',
|
420
420
|
'Content-Type' => 'text/html; charset=utf-8')
|
421
|
-
res = Jpmobile::
|
421
|
+
res = Jpmobile::MobileCarrier.new(Jpmobile::ParamsFilter.new(Jpmobile::Filter.new(RenderParamApp.new))).call(res)
|
422
422
|
req = Rack::Request.new(res[1])
|
423
423
|
expect(req.params['q']).to eq([0xe63e, 0xe63f].pack("U*"))
|
424
424
|
expect(response_body(res)).to eq([0xfe000, 0xfe001].pack("U*"))
|
425
425
|
end
|
426
426
|
|
427
427
|
it 'should not convert 〓' do
|
428
|
-
response = Jpmobile::
|
428
|
+
response = Jpmobile::MobileCarrier.new(Jpmobile::Filter.new(UnitApplication.new('〓'))).call(@res)[2]
|
429
429
|
expect(response_body(response)).to eq('〓')
|
430
430
|
end
|
431
431
|
|
@@ -437,7 +437,7 @@ describe "絵文字が" do
|
|
437
437
|
"REQUEST_METHOD" => "GET",
|
438
438
|
'HTTP_USER_AGENT' => 'Mozilla/5.0 (Linux; U; Android 2.2; ja-jp; SC-01C Build/FROYO) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1',
|
439
439
|
'Content-Type' => 'text/html; charset=utf-8')
|
440
|
-
res = Jpmobile::
|
440
|
+
res = Jpmobile::MobileCarrier.new(Jpmobile::ParamsFilter.new(Jpmobile::Filter.new(RenderParamApp.new))).call(res)
|
441
441
|
req = Rack::Request.new(res[1])
|
442
442
|
expect(req.params['q']).to eq('〓')
|
443
443
|
expect(response_body(res)).to eq('〓')
|