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' => 'Mozilla/4.0 (Compatible; MSIE 6.0; Windows NT 5.1 T-01A_6.5; Windows Phone 6.5)')
|
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::WindowsPhone)
|
15
15
|
expect(env['rack.jpmobile'].position).to be_nil
|
data/spec/rack_helper.rb
CHANGED
data/spec/unit/mail_spec.rb
CHANGED
@@ -342,16 +342,7 @@ describe "Jpmobile::Mail" do
|
|
342
342
|
end
|
343
343
|
|
344
344
|
it "delivers through SMTP" do
|
345
|
-
@mail.delivery_method :smtp, {
|
346
|
-
enable_starttls_auto: false,
|
347
|
-
user_name: ENV['MAILTRAP_USERNAME'],
|
348
|
-
password: ENV['MAILTRAP_PASSWORD'],
|
349
|
-
address: 'smtp.mailtrap.io',
|
350
|
-
domain: 'smtp.mailtrap.io',
|
351
|
-
port: '2525',
|
352
|
-
authentication: :cram_md5
|
353
|
-
}
|
354
|
-
|
345
|
+
@mail.delivery_method :smtp, {:enable_starttls_auto => false}
|
355
346
|
expect {
|
356
347
|
@mail.deliver
|
357
348
|
}.not_to raise_error
|
data/spec/unit/util_spec.rb
CHANGED
@@ -6,77 +6,63 @@ require 'nkf'
|
|
6
6
|
describe Jpmobile::Util do
|
7
7
|
include Jpmobile::Util
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
it 'trueのときはtrueを返すこと' do
|
14
|
-
expect(deep_apply(true) {|obj| obj }).to equal(true)
|
15
|
-
end
|
16
|
-
|
17
|
-
it 'falseのときはそのまま値を返すこと' do
|
18
|
-
expect(deep_apply(false) {|obj| obj }).to equal(false)
|
19
|
-
end
|
20
|
-
|
21
|
-
it 'Tempfileのインスタンスのときはそのまま値を返すこと' do
|
22
|
-
temp = Tempfile.new('test')
|
23
|
-
expect(deep_apply(temp) {|obj| obj}.object_id).to equal(temp.object_id)
|
24
|
-
# 本来 deep_apply(temp) {|obj| obj }.should equal(temp) が通るべきのような。
|
25
|
-
# 参考 http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-list/41720
|
26
|
-
end
|
27
|
-
|
28
|
-
it 'StringIOのインスタンスのときはそのまま値を返すこと' do
|
29
|
-
string_io = StringIO.new('test')
|
30
|
-
expect(deep_apply(string_io) {|obj| obj }).to equal(string_io)
|
31
|
-
end
|
32
|
-
|
33
|
-
it "utf8_to_sjis で変換できない文字列が含んでいた場合?に変換される" do
|
34
|
-
expect(utf8_to_sjis("اللغة العربية")).to eq(sjis("????? ???????"))
|
35
|
-
end
|
9
|
+
describe 'utf8_to_sjis' do
|
10
|
+
it "utf8_to_sjis で変換できない文字列が含んでいた場合?に変換される" do
|
11
|
+
expect(utf8_to_sjis("اللغة العربية")).to eq(sjis("????? ???????"))
|
12
|
+
end
|
36
13
|
|
37
|
-
|
38
|
-
|
39
|
-
|
14
|
+
it "utf8_to_sjis ですべての改行コードが CRLF に変更されること" do
|
15
|
+
expect(utf8_to_sjis("UTF8\rSAMPLE\nTEXT\r\n")).to eq(sjis("UTF8\r\nSAMPLE\r\nTEXT\r\n"))
|
16
|
+
end
|
40
17
|
|
41
|
-
|
42
|
-
|
43
|
-
|
18
|
+
it "U+FFE3が0x8150に変換されること" do
|
19
|
+
expect(utf8_to_sjis([0xffe3].pack("U"))).to eq(sjis("\x81\x50"))
|
20
|
+
end
|
44
21
|
|
45
|
-
|
46
|
-
|
47
|
-
|
22
|
+
it "U+203Eが0x8150に変換されること" do
|
23
|
+
expect(utf8_to_sjis([0x203e].pack("U"))).to eq(sjis("\x81\x50"))
|
24
|
+
end
|
48
25
|
|
49
|
-
|
50
|
-
|
51
|
-
|
26
|
+
it "U+2014が0x815Cに変換されること" do
|
27
|
+
expect(utf8_to_sjis([0x2014].pack("U"))).to eq(sjis("\x81\x5C"))
|
28
|
+
end
|
52
29
|
|
53
|
-
|
54
|
-
|
55
|
-
|
30
|
+
it "U+2212が0x817Cに変換されること" do
|
31
|
+
expect(utf8_to_sjis([0x2212].pack("U"))).to eq(sjis("\x81\x7C"))
|
32
|
+
end
|
56
33
|
|
57
|
-
|
58
|
-
|
34
|
+
it "utf8_to_sjis で変換できない文字列が含んでいた場合?に変換される" do
|
35
|
+
expect(utf8_to_jis("اللغة العربية")).to eq(jis("????? ???????"))
|
36
|
+
end
|
59
37
|
end
|
60
38
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
39
|
+
describe 'sjis_to_utf8' do
|
40
|
+
it "0x8150がU+FFE3に変換されること" do
|
41
|
+
expect(sjis_to_utf8(sjis("\x81\x50"))).to eq([0xffe3].pack("U"))
|
42
|
+
end
|
65
43
|
|
66
|
-
|
67
|
-
|
44
|
+
it "sjis_to_utf8 ですべての改行コードが LF に変更されること" do
|
45
|
+
expect(sjis_to_utf8("SJIS\rSAMPLE\nTEXT\r\n")).to eq(utf8("SJIS\nSAMPLE\nTEXT\n"))
|
46
|
+
end
|
68
47
|
end
|
69
48
|
|
70
|
-
|
71
|
-
|
49
|
+
describe 'utf8_to_jis' do
|
50
|
+
it "utf8_to_jis ですべての改行コードが CRLF に変更されること" do
|
51
|
+
expect(utf8_to_jis("UTF8\rSAMPLE\nTEXT\r\n")).to eq(jis("UTF8\r\nSAMPLE\r\nTEXT\r\n"))
|
52
|
+
end
|
72
53
|
end
|
73
54
|
|
74
|
-
|
75
|
-
|
55
|
+
describe 'jis_string_regexp' do
|
56
|
+
it "jis_string_regexpでISO-2022-JPの文字列がマッチすること" do
|
57
|
+
expect(jis_string_regexp.match(ascii_8bit(utf8_to_jis("abcしからずんばこじをえずdef")))).not_to be_nil
|
58
|
+
expect(jis_to_utf8(jis("\x1b\x24\x42#{$1}\x1b\x28\x42"))).to eq("しからずんばこじをえず")
|
59
|
+
end
|
76
60
|
end
|
77
61
|
|
78
|
-
|
79
|
-
|
62
|
+
describe 'jis_to_utf8' do
|
63
|
+
it "jis_to_utf8 ですべての改行コードが LF に変更されること" do
|
64
|
+
expect(jis_to_utf8("JIS\rSAMPLE\nTEXT\r\n")).to eq(utf8("JIS\nSAMPLE\nTEXT\n"))
|
65
|
+
end
|
80
66
|
end
|
81
67
|
|
82
68
|
describe '#force_encode' do
|
@@ -4,14 +4,16 @@ gem 'jpmobile', path: './vendor/jpmobile'
|
|
4
4
|
gem 'jpmobile-terminfo', path: './vendor/jpmobile-terminfo'
|
5
5
|
gem 'jpmobile-ipaddresses', path: './vendor/jpmobile-ipaddresses'
|
6
6
|
|
7
|
-
gem 'activerecord-session_store'
|
7
|
+
gem 'activerecord-session_store', path: './vendor/activerecord-session_store'
|
8
8
|
|
9
|
-
gem '
|
9
|
+
gem 'pry'
|
10
|
+
gem 'pry-byebug'
|
10
11
|
|
11
12
|
# Bundle gems for certain environments:
|
12
13
|
group :development, :test do
|
13
14
|
gem "rspec"
|
14
15
|
gem "rspec-rails"
|
16
|
+
gem 'capybara'
|
15
17
|
gem 'capybara-webkit'
|
16
|
-
gem '
|
18
|
+
gem 'rails-controller-testing'
|
17
19
|
end
|
@@ -1,35 +1,40 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
class FilterControllerBase < ApplicationController
|
3
3
|
def abracadabra_utf8
|
4
|
-
|
4
|
+
@text = "アブラカダブラ"
|
5
|
+
render 'filter/text_template'
|
5
6
|
end
|
6
7
|
def abracadabra_xhtml_utf8
|
7
8
|
response.content_type = "application/xhtml+xml"
|
8
|
-
|
9
|
+
@text = "アブラカダブラ"
|
10
|
+
render 'filter/text_template'
|
9
11
|
end
|
10
12
|
def index
|
11
13
|
@q = params[:q]
|
12
|
-
render :
|
14
|
+
render plain: @q
|
13
15
|
end
|
14
16
|
def index_hankaku
|
15
|
-
render :
|
17
|
+
render plain: 'アブラカダブラ' == params[:q]
|
16
18
|
end
|
17
19
|
def index_zenkaku
|
18
|
-
render :
|
20
|
+
render plain: 'アブラカダブラ' == params[:q]
|
19
21
|
end
|
20
22
|
def empty
|
21
|
-
render :
|
23
|
+
render plain: ""
|
22
24
|
end
|
23
25
|
def rawdata
|
24
26
|
send_data "アブラカダブラ", :type => 'application/octet-stream'
|
25
27
|
end
|
26
28
|
def textarea
|
27
|
-
|
29
|
+
@text = '<textarea hoge="fuu">アブラカダブラ</textarea>'.html_safe
|
30
|
+
render 'filter/text_template'
|
28
31
|
end
|
29
32
|
def input_tag
|
30
|
-
|
33
|
+
@text = '<input hoge="fuu" value="アブラカダブラ" />'.html_safe
|
34
|
+
render 'filter/text_template'
|
31
35
|
end
|
32
36
|
def nbsp_char
|
33
|
-
|
37
|
+
@text = '<a>アブラ カダブラ</a>'.html_safe
|
38
|
+
render 'filter/text_template'
|
34
39
|
end
|
35
40
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= @text %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
|
-
describe MobileSpecController, :
|
3
|
+
describe MobileSpecController, type: :controller do
|
4
4
|
render_views
|
5
5
|
|
6
6
|
describe "GET 'index'" do
|
@@ -10,7 +10,7 @@ describe MobileSpecController, :type => :controller do
|
|
10
10
|
get 'index'
|
11
11
|
|
12
12
|
expect(response).to be_success
|
13
|
-
expect(response).to
|
13
|
+
expect(response.body).to match(/RailsRoot PC/)
|
14
14
|
expect(request.mobile?).to be_falsey
|
15
15
|
end
|
16
16
|
end
|
@@ -20,7 +20,7 @@ describe MobileSpecController, :type => :controller do
|
|
20
20
|
request.user_agent = "DoCoMo/2.0 SH902i(c100;TB;W24H12)"
|
21
21
|
get 'index'
|
22
22
|
expect(response).to be_success
|
23
|
-
expect(response).to
|
23
|
+
expect(response.body).to match(/RailsRoot mobile/)
|
24
24
|
expect(request.mobile?).to be_truthy
|
25
25
|
expect(request.mobile).to be_a(Jpmobile::Mobile::Docomo)
|
26
26
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
|
-
describe TransSidAlwaysController, :
|
3
|
+
describe TransSidAlwaysController, type: :controller do
|
4
4
|
describe "GET 'redirect_action'" do
|
5
5
|
it "redirects 'form'" do
|
6
6
|
get :redirect_action
|
7
|
-
expect(response).to redirect_to(:
|
7
|
+
expect(response).to redirect_to(action: 'form')
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
@@ -1,13 +1,14 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
1
2
|
require 'rails_helper'
|
2
3
|
|
3
|
-
describe "jpmobile integration spec", :
|
4
|
+
describe "jpmobile integration spec", type: :feature do
|
4
5
|
include Jpmobile::Util
|
5
6
|
|
6
7
|
before do
|
7
8
|
page.driver.header('User-Agent', user_agent)
|
8
9
|
end
|
9
10
|
|
10
|
-
shared_examples_for "hankaku_filter :
|
11
|
+
shared_examples_for "hankaku_filter input: true のとき" do
|
11
12
|
it "はtextareaの中では半角に変換されないこと" do
|
12
13
|
visit "/#{controller}/textarea"
|
13
14
|
expect(page.body.encode('UTF-8')).to have_content('アブラカダブラ')
|
@@ -18,11 +19,11 @@ describe "jpmobile integration spec", :type => :feature do
|
|
18
19
|
end
|
19
20
|
it "は 変換されない" do
|
20
21
|
visit "/#{controller}/nbsp_char"
|
21
|
-
expect(page.body.encode('UTF-8')).to have_content(
|
22
|
+
expect(page.body.encode('UTF-8')).to have_content('アブラ カダブラ')
|
22
23
|
end
|
23
24
|
end
|
24
25
|
|
25
|
-
shared_examples_for "hankaku_filter :
|
26
|
+
shared_examples_for "hankaku_filter input: false のとき" do
|
26
27
|
it "はtextareaの中でも半角に変換されること" do
|
27
28
|
visit "/#{controller}/textarea"
|
28
29
|
expect(page.body.encode('UTF-8')).to have_content('アブラカダブラ')
|
@@ -33,7 +34,7 @@ describe "jpmobile integration spec", :type => :feature do
|
|
33
34
|
end
|
34
35
|
it "は 変換されない" do
|
35
36
|
visit "/#{controller}/nbsp_char"
|
36
|
-
expect(page.body.encode('UTF-8')).to have_content(
|
37
|
+
expect(page.body.encode('UTF-8')).to have_content('アブラ カダブラ')
|
37
38
|
end
|
38
39
|
end
|
39
40
|
|
@@ -188,7 +189,7 @@ describe "jpmobile integration spec", :type => :feature do
|
|
188
189
|
}
|
189
190
|
|
190
191
|
it_should_behave_like "Shift_JISで通信する端末との通信(半角変換付き)"
|
191
|
-
it_should_behave_like "hankaku_filter :
|
192
|
+
it_should_behave_like "hankaku_filter input: false のとき"
|
192
193
|
end
|
193
194
|
|
194
195
|
describe "SoftBank 910T からのアクセス" do
|
@@ -197,7 +198,7 @@ describe "jpmobile integration spec", :type => :feature do
|
|
197
198
|
}
|
198
199
|
|
199
200
|
it_should_behave_like "UTF-8で通信する端末との通信(半角変換付き)"
|
200
|
-
it_should_behave_like "hankaku_filter :
|
201
|
+
it_should_behave_like "hankaku_filter input: false のとき"
|
201
202
|
end
|
202
203
|
end
|
203
204
|
|
@@ -210,7 +211,7 @@ describe "jpmobile integration spec", :type => :feature do
|
|
210
211
|
}
|
211
212
|
|
212
213
|
it_should_behave_like "Shift_JISで通信する端末との通信(半角変換付き)"
|
213
|
-
it_should_behave_like "hankaku_filter :
|
214
|
+
it_should_behave_like "hankaku_filter input: true のとき"
|
214
215
|
|
215
216
|
it "Content-Type が Shift_JIS であること" do
|
216
217
|
visit "/#{controller }/with_charset"
|
@@ -224,7 +225,7 @@ describe "jpmobile integration spec", :type => :feature do
|
|
224
225
|
end
|
225
226
|
|
226
227
|
it_should_behave_like "UTF-8で通信する端末との通信(半角変換付き)"
|
227
|
-
it_should_behave_like "hankaku_filter :
|
228
|
+
it_should_behave_like "hankaku_filter input: true のとき"
|
228
229
|
|
229
230
|
it "Content-Type が UTF-8 であること" do
|
230
231
|
visit "/#{controller}/with_charset"
|
@@ -1,13 +1,15 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
|
-
describe Jpmobile::Helpers, :
|
3
|
+
describe Jpmobile::Helpers, type: :helper do
|
4
4
|
include Jpmobile::Helpers
|
5
|
+
include Rails.application.routes.url_helpers
|
6
|
+
|
5
7
|
it "docomo_guid_link_to が guid=ON を付けたリンクを生成すること" do
|
6
|
-
expect(docomo_guid_link_to("STRING", :controller
|
8
|
+
expect(docomo_guid_link_to("STRING", host: 'jpmobile.info', controller: "filter", action: "rawdata")).to eq(%{<a href="http://jpmobile.info/filter/rawdata?guid=ON">STRING</a>})
|
7
9
|
end
|
8
10
|
|
9
11
|
it "softbank_location_link_to がリンク先にパラメータを含んでいても正常に動作すること" do
|
10
12
|
# http://d.hatena.ne.jp/mizincogrammer/20090123/1232702067
|
11
|
-
expect(softbank_location_link_to("STRING", :controller
|
13
|
+
expect(softbank_location_link_to("STRING", host: 'jpmobile.info', controller: "filter", action: "rawdata", p: "param")).to eq(%{<a href="location:auto?url=http://jpmobile.info/filter/rawdata&p=param">STRING</a>})
|
12
14
|
end
|
13
15
|
end
|
@@ -1,30 +1,30 @@
|
|
1
1
|
require 'rails_helper'
|
2
2
|
|
3
|
-
describe "DoCoMo SH902i からのアクセス", :
|
3
|
+
describe "DoCoMo SH902i からのアクセス", type: :request do
|
4
4
|
it "request.mobile は Docomo のインスタンスであるべき" do
|
5
|
-
get "/mobile_spec/index", {}, {"HTTP_USER_AGENT" => "DoCoMo/2.0 SH902i(c100;TB;W24H12)"}
|
5
|
+
get "/mobile_spec/index", params: {}, env: {"HTTP_USER_AGENT" => "DoCoMo/2.0 SH902i(c100;TB;W24H12)"}
|
6
6
|
|
7
7
|
expect(request.mobile).to be_an_instance_of(Jpmobile::Mobile::Docomo)
|
8
8
|
end
|
9
9
|
it "request.mobile? は true であるべき" do
|
10
|
-
get "/mobile_spec/index", {}, {"HTTP_USER_AGENT" => "DoCoMo/2.0 SH902i(c100;TB;W24H12)"}
|
10
|
+
get "/mobile_spec/index", params: {}, env: {"HTTP_USER_AGENT" => "DoCoMo/2.0 SH902i(c100;TB;W24H12)"}
|
11
11
|
|
12
12
|
expect(request.mobile?).to be_truthy
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
describe "DoCoMo SH902i からguid付きのアクセス", :
|
16
|
+
describe "DoCoMo SH902i からguid付きのアクセス", type: :request do
|
17
17
|
before(:each) do
|
18
18
|
@headers = {"HTTP_USER_AGENT" => "DoCoMo/2.0 SH902i(c100;TB;W24H12)", 'HTTP_X_DCMGUID' => "000000a"}
|
19
19
|
end
|
20
20
|
|
21
21
|
it "guidを正しく取得できること" do
|
22
|
-
get "/mobile_spec/index", {}, @headers
|
22
|
+
get "/mobile_spec/index", params: {}, env: @headers
|
23
23
|
|
24
24
|
expect(request.mobile.guid).to eq("000000a")
|
25
25
|
end
|
26
26
|
it "ident_subscriberでも正しく取得できること" do
|
27
|
-
get "/mobile_spec/index", {}, @headers
|
27
|
+
get "/mobile_spec/index", params: {}, env: @headers
|
28
28
|
|
29
29
|
expect(request.mobile.ident_subscriber).to eq("000000a")
|
30
30
|
end
|
@@ -10,22 +10,22 @@ describe "H11T モバイルブラウザからのアクセス" do
|
|
10
10
|
end
|
11
11
|
|
12
12
|
it "request.mobile は Emobile のインスタンスであること" do
|
13
|
-
get "/mobile_spec/index", {}, @headers
|
13
|
+
get "/mobile_spec/index", params: {}, env: @headers
|
14
14
|
|
15
15
|
expect(request.mobile).to be_an_instance_of(Jpmobile::Mobile::Emobile)
|
16
16
|
end
|
17
17
|
it "request.mobile? は true であること" do
|
18
|
-
get "/mobile_spec/index", {}, @headers
|
18
|
+
get "/mobile_spec/index", params: {}, env: @headers
|
19
19
|
|
20
20
|
expect(request.mobile?).to be_truthy
|
21
21
|
end
|
22
22
|
it "のsubscribe番号を取得できること" do
|
23
|
-
get "/mobile_spec/index", {}, @headers
|
23
|
+
get "/mobile_spec/index", params: {}, env: @headers
|
24
24
|
|
25
25
|
expect(request.mobile.ident_subscriber).to eq("u00000000000000000")
|
26
26
|
end
|
27
27
|
it "のIPアドレス空間を正しく検証できること" do
|
28
|
-
get "/mobile_spec/index", {}, @headers
|
28
|
+
get "/mobile_spec/index", params: {}, env: @headers
|
29
29
|
|
30
30
|
expect(request.mobile.valid_ip?).to be_truthy
|
31
31
|
end
|
@@ -39,12 +39,12 @@ describe "S11HT からのアクセス" do
|
|
39
39
|
end
|
40
40
|
|
41
41
|
it "request.mobile は Emobile のインスタンスであること" do
|
42
|
-
get "/mobile_spec/index", {}, @headers
|
42
|
+
get "/mobile_spec/index", params: {}, env: @headers
|
43
43
|
|
44
44
|
expect(request.mobile).to be_an_instance_of(Jpmobile::Mobile::Emobile)
|
45
45
|
end
|
46
46
|
it "request.mobile? は true であること" do
|
47
|
-
get "/mobile_spec/index", {}, @headers
|
47
|
+
get "/mobile_spec/index", params: {}, env: @headers
|
48
48
|
|
49
49
|
expect(request.mobile?).to be_truthy
|
50
50
|
end
|