jpmobile 4.1.0 → 4.1.1
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/README.rdoc +1 -1
- data/jpmobile.gemspec +1 -0
- data/lib/jpmobile/hook_action_controller.rb +10 -7
- data/lib/jpmobile/position.rb +1 -0
- data/lib/jpmobile/rails.rb +1 -1
- data/lib/jpmobile/resolver.rb +1 -7
- data/lib/jpmobile/trans_sid.rb +1 -1
- data/lib/jpmobile/version.rb +1 -1
- data/spec/rack/jpmobile/android_spec.rb +2 -2
- data/spec/rack/jpmobile/au_spec.rb +10 -10
- data/spec/rack/jpmobile/black_berry_spec.rb +2 -2
- data/spec/rack/jpmobile/docomo_spec.rb +8 -8
- data/spec/rack/jpmobile/emoticon_spec.rb +2 -2
- data/spec/rack/jpmobile/iphone_spec.rb +3 -3
- data/spec/rack/jpmobile/softbank_spec.rb +7 -7
- data/spec/rack/jpmobile/willcom_spec.rb +4 -4
- data/spec/rack/jpmobile/windows_phone.rb +2 -2
- data/spec/rack_helper.rb +4 -1
- data/spec/unit/email_spec.rb +2 -2
- data/spec/unit/mobile/iphone_spec.rb +3 -3
- data/spec/unit/spec_helper.rb +10 -6
- data/spec/unit/util_spec.rb +2 -2
- data/test/rails/overrides/.rspec +3 -5
- data/test/rails/overrides/app/controllers/trans_sid_always_and_session_off_controller.rb +1 -1
- data/test/rails/overrides/app/controllers/trans_sid_base_controller.rb +1 -1
- data/test/rails/overrides/app/controllers/trans_sid_metal_controller.rb +1 -1
- data/test/rails/overrides/spec/controllers/docomo_guid_spec.rb +1 -1
- data/test/rails/overrides/spec/controllers/helpers_spec.rb +1 -3
- data/test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb +5 -6
- data/test/rails/overrides/spec/controllers/template_path_spec.rb +1 -2
- data/test/rails/overrides/spec/controllers/trans_sid_controller_spec.rb +1 -2
- data/test/rails/overrides/spec/features/admin/top_spec.rb +1 -2
- data/test/rails/overrides/spec/features/filter_spec.rb +1 -2
- data/test/rails/overrides/spec/helpers/helpers_spec.rb +1 -2
- data/test/rails/overrides/spec/mailers/decorated_mailer_spec.rb +1 -2
- data/test/rails/overrides/spec/mailers/mobile_mailer_spec.rb +9 -10
- data/test/rails/overrides/spec/mailers/normal_mailer_spec.rb +1 -2
- data/test/rails/overrides/spec/rails_helper.rb +60 -0
- data/test/rails/overrides/spec/requests/docomo_spec.rb +2 -3
- data/test/rails/overrides/spec/requests/emobile_spec.rb +4 -5
- data/test/rails/overrides/spec/requests/pc_spec.rb +2 -3
- data/test/rails/overrides/spec/requests/softbank_emulator_spec.rb +3 -4
- data/test/rails/overrides/spec/requests/template_path_spec.rb +1 -2
- data/test/rails/overrides/spec/requests/trans_sid_spec.rb +1 -2
- data/test/rails/overrides/spec/spec_helper.rb +72 -33
- metadata +18 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2f83dece3c3b1f70371b5aca9bcba8b1ded28abe
|
|
4
|
+
data.tar.gz: 28d2542170610c2d2fe9af4728c3b2b04301dc73
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bbba29855f49366f51dd5a172578181d1c9c887dd8e8d1c2a3211f8faf18e3f68868236d0fc11d7ba64f22062f600e6218938abf1a68ff6673a87ce1e0add9df
|
|
7
|
+
data.tar.gz: 01147d7316262342db4fc75a3aa74c4ea165592b1542bcd738f687098fb7987e00212ac7d477949d48ff3564372657f3d5e9667c6e880af6211cc657cf666dbb
|
data/README.rdoc
CHANGED
data/jpmobile.gemspec
CHANGED
|
@@ -19,6 +19,7 @@ Gem::Specification.new do |gem|
|
|
|
19
19
|
gem.add_development_dependency 'rails'
|
|
20
20
|
gem.add_development_dependency 'rspec'
|
|
21
21
|
gem.add_development_dependency 'rspec-rails'
|
|
22
|
+
gem.add_development_dependency 'rspec-its'
|
|
22
23
|
gem.add_development_dependency 'capybara-webkit'
|
|
23
24
|
gem.add_development_dependency 'geokit'
|
|
24
25
|
gem.add_development_dependency 'sqlite3-ruby'
|
|
@@ -4,13 +4,16 @@ require 'jpmobile/lookup_context'
|
|
|
4
4
|
module ActionController
|
|
5
5
|
class Base
|
|
6
6
|
include Jpmobile::Helpers
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
|
|
8
|
+
if Object.const_defined?(:GetText)
|
|
9
|
+
before_action :gettext_force_ja_for_mobile
|
|
10
|
+
# gettextが組み込まれている場合、携帯電話からのアクセスをjaロケールに強制する。
|
|
11
|
+
def gettext_force_ja_for_mobile
|
|
12
|
+
if request.mobile?
|
|
13
|
+
begin
|
|
14
|
+
::GetText.locale = 'ja'
|
|
15
|
+
rescue NameError
|
|
16
|
+
end
|
|
14
17
|
end
|
|
15
18
|
end
|
|
16
19
|
end
|
data/lib/jpmobile/position.rb
CHANGED
data/lib/jpmobile/rails.rb
CHANGED
|
@@ -31,7 +31,7 @@ module Jpmobile
|
|
|
31
31
|
module ViewSelector
|
|
32
32
|
def self.included(base)
|
|
33
33
|
base.class_eval do
|
|
34
|
-
|
|
34
|
+
before_action :register_mobile
|
|
35
35
|
|
|
36
36
|
self._view_paths = self._view_paths.dup
|
|
37
37
|
self.view_paths.unshift(*self.view_paths.map {|resolver| Jpmobile::Resolver.new(resolver.to_path) })
|
data/lib/jpmobile/resolver.rb
CHANGED
|
@@ -14,13 +14,7 @@ module Jpmobile
|
|
|
14
14
|
def query(path, details, formats)
|
|
15
15
|
query = build_query(path, details)
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
sanitizer = Hash.new { |h,dir| h[dir] = Dir["#{dir}/*"] }
|
|
19
|
-
|
|
20
|
-
template_paths = Dir[query].reject { |filename|
|
|
21
|
-
File.directory?(filename) ||
|
|
22
|
-
!sanitizer[File.dirname(filename)].include?(filename)
|
|
23
|
-
}
|
|
17
|
+
template_paths = find_template_paths query
|
|
24
18
|
|
|
25
19
|
template_paths.map { |template|
|
|
26
20
|
handler, format, variant = extract_handler_and_format_and_variant(template, formats)
|
data/lib/jpmobile/trans_sid.rb
CHANGED
data/lib/jpmobile/version.rb
CHANGED
|
@@ -13,8 +13,8 @@ describe Jpmobile::Rack::MobileCarrier, "android" do
|
|
|
13
13
|
|
|
14
14
|
env['rack.jpmobile'].class.should == Jpmobile::Mobile::Android
|
|
15
15
|
env['rack.jpmobile'].position.should be_nil
|
|
16
|
-
env['rack.jpmobile'].smart_phone?.should
|
|
17
|
-
env['rack.jpmobile'].supports_cookie?.should
|
|
16
|
+
env['rack.jpmobile'].smart_phone?.should be_truthy
|
|
17
|
+
env['rack.jpmobile'].supports_cookie?.should be_truthy
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
end
|
|
@@ -18,7 +18,7 @@ describe Jpmobile::Rack::MobileCarrier, "au" do
|
|
|
18
18
|
env['rack.jpmobile'].ident_subscriber.should == "00000000000000_mj.ezweb.ne.jp"
|
|
19
19
|
|
|
20
20
|
env['rack.jpmobile'].position.should be_nil
|
|
21
|
-
env['rack.jpmobile'].supports_cookie?.should
|
|
21
|
+
env['rack.jpmobile'].supports_cookie?.should be_truthy
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
it "TK22 で判別できること" do
|
|
@@ -121,8 +121,8 @@ describe Jpmobile::Rack::MobileCarrier, "au" do
|
|
|
121
121
|
env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
|
122
122
|
|
|
123
123
|
env['rack.jpmobile'].device_id.should == "CA32"
|
|
124
|
-
env['rack.jpmobile'].supports_location?.should
|
|
125
|
-
env['rack.jpmobile'].supports_gps?.should
|
|
124
|
+
env['rack.jpmobile'].supports_location?.should be_truthy
|
|
125
|
+
env['rack.jpmobile'].supports_gps?.should be_truthy
|
|
126
126
|
end
|
|
127
127
|
|
|
128
128
|
it "A1402S を判定できること" do
|
|
@@ -132,8 +132,8 @@ describe Jpmobile::Rack::MobileCarrier, "au" do
|
|
|
132
132
|
env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
|
133
133
|
|
|
134
134
|
env['rack.jpmobile'].device_id.should == "SN26"
|
|
135
|
-
env['rack.jpmobile'].supports_location?.should
|
|
136
|
-
env['rack.jpmobile'].supports_gps?.should
|
|
135
|
+
env['rack.jpmobile'].supports_location?.should be_truthy
|
|
136
|
+
env['rack.jpmobile'].supports_gps?.should be_falsey
|
|
137
137
|
end
|
|
138
138
|
|
|
139
139
|
it "TK22 を判定できること" do
|
|
@@ -143,8 +143,8 @@ describe Jpmobile::Rack::MobileCarrier, "au" do
|
|
|
143
143
|
env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
|
144
144
|
|
|
145
145
|
env['rack.jpmobile'].device_id.should == "KCTA"
|
|
146
|
-
env['rack.jpmobile'].supports_location?.should
|
|
147
|
-
env['rack.jpmobile'].supports_gps?.should
|
|
146
|
+
env['rack.jpmobile'].supports_location?.should be_falsey
|
|
147
|
+
env['rack.jpmobile'].supports_gps?.should be_falsey
|
|
148
148
|
end
|
|
149
149
|
end
|
|
150
150
|
end
|
|
@@ -157,7 +157,7 @@ describe Jpmobile::Rack::MobileCarrier, "au" do
|
|
|
157
157
|
"REMOTE_ADDR" => "210.230.128.225")
|
|
158
158
|
env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
|
159
159
|
|
|
160
|
-
env['rack.jpmobile'].valid_ip?.should
|
|
160
|
+
env['rack.jpmobile'].valid_ip?.should be_truthy
|
|
161
161
|
end
|
|
162
162
|
|
|
163
163
|
it "正しくないIPアドレス空間からのアクセスを判断できること" do
|
|
@@ -167,7 +167,7 @@ describe Jpmobile::Rack::MobileCarrier, "au" do
|
|
|
167
167
|
"REMOTE_ADDR" => "127.0.0.1")
|
|
168
168
|
env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
|
169
169
|
|
|
170
|
-
env['rack.jpmobile'].valid_ip?.should
|
|
170
|
+
env['rack.jpmobile'].valid_ip?.should be_falsey
|
|
171
171
|
end
|
|
172
172
|
end
|
|
173
173
|
|
|
@@ -183,7 +183,7 @@ describe Jpmobile::Rack::MobileCarrier, "au" do
|
|
|
183
183
|
|
|
184
184
|
env['rack.jpmobile'].display.width.should == 240
|
|
185
185
|
env['rack.jpmobile'].display.height.should == 346
|
|
186
|
-
env['rack.jpmobile'].display.color?.should
|
|
186
|
+
env['rack.jpmobile'].display.color?.should be_truthy
|
|
187
187
|
env['rack.jpmobile'].display.colors.should == 65536
|
|
188
188
|
end
|
|
189
189
|
|
|
@@ -13,8 +13,8 @@ describe Jpmobile::Rack::MobileCarrier, "Windows Phone" do
|
|
|
13
13
|
|
|
14
14
|
env['rack.jpmobile'].class.should == Jpmobile::Mobile::BlackBerry
|
|
15
15
|
env['rack.jpmobile'].position.should be_nil
|
|
16
|
-
env['rack.jpmobile'].smart_phone?.should
|
|
17
|
-
env['rack.jpmobile'].supports_cookie?.should
|
|
16
|
+
env['rack.jpmobile'].smart_phone?.should be_truthy
|
|
17
|
+
env['rack.jpmobile'].supports_cookie?.should be_truthy
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
end
|
|
@@ -27,7 +27,7 @@ describe Jpmobile::Rack::MobileCarrier, "docomo" do
|
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
it "#supports_cookie? などが false になること" do
|
|
30
|
-
@env['rack.jpmobile'].supports_cookie?.should
|
|
30
|
+
@env['rack.jpmobile'].supports_cookie?.should be_falsey
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
it "#imode_browser_versionが1.0になること" do
|
|
@@ -58,7 +58,7 @@ describe Jpmobile::Rack::MobileCarrier, "docomo" do
|
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
it "#supports_cookie? などが false になること" do
|
|
61
|
-
@env['rack.jpmobile'].supports_cookie?.should
|
|
61
|
+
@env['rack.jpmobile'].supports_cookie?.should be_falsey
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
it "#imode_browser_versionが1.0になること" do
|
|
@@ -75,7 +75,7 @@ describe Jpmobile::Rack::MobileCarrier, "docomo" do
|
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
it "#supports_cookie? が true になること" do
|
|
78
|
-
@env['rack.jpmobile'].supports_cookie?.should
|
|
78
|
+
@env['rack.jpmobile'].supports_cookie?.should be_truthy
|
|
79
79
|
end
|
|
80
80
|
|
|
81
81
|
it "#imode_browser_versionが2.0になること" do
|
|
@@ -92,7 +92,7 @@ describe Jpmobile::Rack::MobileCarrier, "docomo" do
|
|
|
92
92
|
end
|
|
93
93
|
|
|
94
94
|
it "#supports_cookie? が true になること" do
|
|
95
|
-
@env['rack.jpmobile'].supports_cookie?.should
|
|
95
|
+
@env['rack.jpmobile'].supports_cookie?.should be_truthy
|
|
96
96
|
end
|
|
97
97
|
|
|
98
98
|
it "#imode_browser_versionが2.0になること" do
|
|
@@ -109,7 +109,7 @@ describe Jpmobile::Rack::MobileCarrier, "docomo" do
|
|
|
109
109
|
end
|
|
110
110
|
|
|
111
111
|
it "#supports_cookie? が true になること" do
|
|
112
|
-
@env['rack.jpmobile'].supports_cookie?.should
|
|
112
|
+
@env['rack.jpmobile'].supports_cookie?.should be_truthy
|
|
113
113
|
end
|
|
114
114
|
|
|
115
115
|
it "#imode_browser_versionが2.0になること" do
|
|
@@ -205,7 +205,7 @@ describe Jpmobile::Rack::MobileCarrier, "docomo" do
|
|
|
205
205
|
"REMOTE_ADDR" => "210.153.84.1")
|
|
206
206
|
env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
|
207
207
|
|
|
208
|
-
env['rack.jpmobile'].valid_ip?.should
|
|
208
|
+
env['rack.jpmobile'].valid_ip?.should be_truthy
|
|
209
209
|
end
|
|
210
210
|
|
|
211
211
|
it "正しくないIPアドレス空間からのアクセスを判断できること" do
|
|
@@ -215,7 +215,7 @@ describe Jpmobile::Rack::MobileCarrier, "docomo" do
|
|
|
215
215
|
"REMOTE_ADDR" => "127.0.0.1")
|
|
216
216
|
env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
|
217
217
|
|
|
218
|
-
env['rack.jpmobile'].valid_ip?.should
|
|
218
|
+
env['rack.jpmobile'].valid_ip?.should be_falsey
|
|
219
219
|
end
|
|
220
220
|
end
|
|
221
221
|
|
|
@@ -230,7 +230,7 @@ describe Jpmobile::Rack::MobileCarrier, "docomo" do
|
|
|
230
230
|
env['rack.jpmobile'].display.browser_height.should == 256
|
|
231
231
|
env['rack.jpmobile'].display.width.should == 240
|
|
232
232
|
env['rack.jpmobile'].display.height.should == 256
|
|
233
|
-
env['rack.jpmobile'].display.color?.should
|
|
233
|
+
env['rack.jpmobile'].display.color?.should be_truthy
|
|
234
234
|
env['rack.jpmobile'].display.colors.should == 262144
|
|
235
235
|
end
|
|
236
236
|
end
|
|
@@ -54,7 +54,7 @@ describe "絵文字が" do
|
|
|
54
54
|
before(:each) do
|
|
55
55
|
unless FileTest.exist?(File.join(File.expand_path(File.dirname(__FILE__)), '../../../tmp/emoticon.yaml')) and
|
|
56
56
|
FileTest.directory?(File.join(File.expand_path(File.dirname(__FILE__)), '../../../tmp/emoticons'))
|
|
57
|
-
|
|
57
|
+
skip "emoticon.yaml and emoticons directory don't exists"
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
@res = Rack::MockRequest.env_for("/", 'Content-Type' => 'text/html; charset=utf-8')
|
|
@@ -69,7 +69,7 @@ describe "絵文字が" do
|
|
|
69
69
|
end
|
|
70
70
|
|
|
71
71
|
it "Jpmobile::Emoticon.pc_emoticon? がtrueになること" do
|
|
72
|
-
Jpmobile::Emoticon.pc_emoticon?.should
|
|
72
|
+
Jpmobile::Emoticon.pc_emoticon?.should be_truthy
|
|
73
73
|
end
|
|
74
74
|
|
|
75
75
|
it "docomo 絵文字が画像に変換されること" do
|
|
@@ -13,8 +13,8 @@ describe Jpmobile::Rack::MobileCarrier, "iphone" do
|
|
|
13
13
|
|
|
14
14
|
env['rack.jpmobile'].class.should == Jpmobile::Mobile::Iphone
|
|
15
15
|
env['rack.jpmobile'].position.should be_nil
|
|
16
|
-
env['rack.jpmobile'].smart_phone?.should
|
|
17
|
-
env['rack.jpmobile'].supports_cookie?.should
|
|
16
|
+
env['rack.jpmobile'].smart_phone?.should be_truthy
|
|
17
|
+
env['rack.jpmobile'].supports_cookie?.should be_truthy
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
|
|
@@ -26,7 +26,7 @@ describe Jpmobile::Rack::MobileCarrier, "iphone" do
|
|
|
26
26
|
"REMOTE_ADDR"=>"202.179.204.1")
|
|
27
27
|
env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
|
28
28
|
|
|
29
|
-
env['rack.jpmobile'].valid_ip?.should
|
|
29
|
+
env['rack.jpmobile'].valid_ip?.should be_falsey
|
|
30
30
|
end
|
|
31
31
|
end
|
|
32
32
|
end
|
|
@@ -17,8 +17,8 @@ describe Jpmobile::Rack::MobileCarrier, "softbank" do
|
|
|
17
17
|
env['rack.jpmobile'].ident.should == "000000000000000"
|
|
18
18
|
env['rack.jpmobile'].ident_device.should == "000000000000000"
|
|
19
19
|
env['rack.jpmobile'].ident_subscriber.should be_nil
|
|
20
|
-
env['rack.jpmobile'].supports_cookie?.should
|
|
21
|
-
env['rack.jpmobile'].smart_phone?.should
|
|
20
|
+
env['rack.jpmobile'].supports_cookie?.should be_truthy
|
|
21
|
+
env['rack.jpmobile'].smart_phone?.should be_falsey
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
it "X_JPHONE_UID 付きの 910T を判別できること" do
|
|
@@ -33,7 +33,7 @@ describe Jpmobile::Rack::MobileCarrier, "softbank" do
|
|
|
33
33
|
env['rack.jpmobile'].ident.should == "aaaaaaaaaaaaaaaa"
|
|
34
34
|
env['rack.jpmobile'].ident_device.should == "000000000000000"
|
|
35
35
|
env['rack.jpmobile'].ident_subscriber.should == "aaaaaaaaaaaaaaaa"
|
|
36
|
-
env['rack.jpmobile'].supports_cookie?.should
|
|
36
|
+
env['rack.jpmobile'].supports_cookie?.should be_truthy
|
|
37
37
|
end
|
|
38
38
|
|
|
39
39
|
it "V903T を判別できること" do
|
|
@@ -45,7 +45,7 @@ describe Jpmobile::Rack::MobileCarrier, "softbank" do
|
|
|
45
45
|
env['rack.jpmobile'].class.should == Jpmobile::Mobile::Vodafone
|
|
46
46
|
env['rack.jpmobile'].position.should be_nil
|
|
47
47
|
env['rack.jpmobile'].ident.should be_nil
|
|
48
|
-
env['rack.jpmobile'].supports_cookie?.should
|
|
48
|
+
env['rack.jpmobile'].supports_cookie?.should be_truthy
|
|
49
49
|
end
|
|
50
50
|
end
|
|
51
51
|
|
|
@@ -73,7 +73,7 @@ describe Jpmobile::Rack::MobileCarrier, "softbank" do
|
|
|
73
73
|
"REMOTE_ADDR"=>"210.146.7.199")
|
|
74
74
|
env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
|
75
75
|
|
|
76
|
-
env['rack.jpmobile'].valid_ip?.should
|
|
76
|
+
env['rack.jpmobile'].valid_ip?.should be_truthy
|
|
77
77
|
end
|
|
78
78
|
|
|
79
79
|
it "正しくないIPアドレス空間からのアクセスを判断できること" do
|
|
@@ -83,7 +83,7 @@ describe Jpmobile::Rack::MobileCarrier, "softbank" do
|
|
|
83
83
|
"REMOTE_ADDR"=>"127.0.0.1")
|
|
84
84
|
env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
|
85
85
|
|
|
86
|
-
env['rack.jpmobile'].valid_ip?.should
|
|
86
|
+
env['rack.jpmobile'].valid_ip?.should be_falsey
|
|
87
87
|
end
|
|
88
88
|
end
|
|
89
89
|
|
|
@@ -100,7 +100,7 @@ describe Jpmobile::Rack::MobileCarrier, "softbank" do
|
|
|
100
100
|
env['rack.jpmobile'].display.height.should == 320
|
|
101
101
|
env['rack.jpmobile'].display.physical_width.should == 240
|
|
102
102
|
env['rack.jpmobile'].display.physical_height.should == 320
|
|
103
|
-
env['rack.jpmobile'].display.color?.should
|
|
103
|
+
env['rack.jpmobile'].display.color?.should be_truthy
|
|
104
104
|
env['rack.jpmobile'].display.colors.should == 262144
|
|
105
105
|
end
|
|
106
106
|
|
|
@@ -14,7 +14,7 @@ describe Jpmobile::Rack::MobileCarrier, "willcom" do
|
|
|
14
14
|
env['rack.jpmobile'].class.should == Jpmobile::Mobile::Willcom
|
|
15
15
|
env['rack.jpmobile'].position.should be_nil
|
|
16
16
|
env['rack.jpmobile'].ident.should be_nil
|
|
17
|
-
env['rack.jpmobile'].supports_cookie?.should
|
|
17
|
+
env['rack.jpmobile'].supports_cookie?.should be_truthy
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
it "AH-H3001V が判別できること" do
|
|
@@ -26,7 +26,7 @@ describe Jpmobile::Rack::MobileCarrier, "willcom" do
|
|
|
26
26
|
env['rack.jpmobile'].class.should == Jpmobile::Mobile::Ddipocket
|
|
27
27
|
env['rack.jpmobile'].position.should be_nil
|
|
28
28
|
env['rack.jpmobile'].ident.should be_nil
|
|
29
|
-
env['rack.jpmobile'].supports_cookie?.should
|
|
29
|
+
env['rack.jpmobile'].supports_cookie?.should be_truthy
|
|
30
30
|
end
|
|
31
31
|
end
|
|
32
32
|
|
|
@@ -51,7 +51,7 @@ describe Jpmobile::Rack::MobileCarrier, "willcom" do
|
|
|
51
51
|
"REMOTE_ADDR" => "61.198.142.1")
|
|
52
52
|
env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
|
53
53
|
|
|
54
|
-
env['rack.jpmobile'].valid_ip?.should
|
|
54
|
+
env['rack.jpmobile'].valid_ip?.should be_truthy
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
it "正しくないIPアドレス空間からのアクセスを判断できること" do
|
|
@@ -61,7 +61,7 @@ describe Jpmobile::Rack::MobileCarrier, "willcom" do
|
|
|
61
61
|
"REMOTE_ADDR" => "127.0.0.1")
|
|
62
62
|
env = Jpmobile::Rack::MobileCarrier.new(UnitApplication.new).call(res)[1]
|
|
63
63
|
|
|
64
|
-
env['rack.jpmobile'].valid_ip?.should
|
|
64
|
+
env['rack.jpmobile'].valid_ip?.should be_falsey
|
|
65
65
|
end
|
|
66
66
|
end
|
|
67
67
|
end
|
|
@@ -13,8 +13,8 @@ describe Jpmobile::Rack::MobileCarrier, "Windows Phone" do
|
|
|
13
13
|
|
|
14
14
|
env['rack.jpmobile'].class.should == Jpmobile::Mobile::WindowsPhone
|
|
15
15
|
env['rack.jpmobile'].position.should be_nil
|
|
16
|
-
env['rack.jpmobile'].smart_phone?.should
|
|
17
|
-
env['rack.jpmobile'].supports_cookie?.should
|
|
16
|
+
env['rack.jpmobile'].smart_phone?.should be_truthy
|
|
17
|
+
env['rack.jpmobile'].supports_cookie?.should be_truthy
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
end
|
data/spec/rack_helper.rb
CHANGED
|
@@ -21,7 +21,10 @@ end
|
|
|
21
21
|
RSpec.configure do |config|
|
|
22
22
|
config.filter_run :focus => true
|
|
23
23
|
config.run_all_when_everything_filtered = true
|
|
24
|
-
config.
|
|
24
|
+
config.color = true
|
|
25
|
+
config.expect_with :rspec do |c|
|
|
26
|
+
c.syntax = [:should, :expect]
|
|
27
|
+
end
|
|
25
28
|
end
|
|
26
29
|
|
|
27
30
|
class UnitApplication
|
data/spec/unit/email_spec.rb
CHANGED
|
@@ -63,11 +63,11 @@ describe 'Jpmobile::Email' do
|
|
|
63
63
|
|
|
64
64
|
describe "convertable?" do
|
|
65
65
|
it "return true when text/plain; charset=iso-2022-jp" do
|
|
66
|
-
Jpmobile::Email.convertable?('text/plain; charset=iso-2022-jp').should
|
|
66
|
+
Jpmobile::Email.convertable?('text/plain; charset=iso-2022-jp').should be_truthy
|
|
67
67
|
end
|
|
68
68
|
|
|
69
69
|
it "return true when text/html; charset=shift_jis" do
|
|
70
|
-
Jpmobile::Email.convertable?('text/html; charset=shift_jis').should
|
|
70
|
+
Jpmobile::Email.convertable?('text/html; charset=shift_jis').should be_truthy
|
|
71
71
|
end
|
|
72
72
|
|
|
73
73
|
it "return nil when image/jpeg; name=\"20098calendar01.jpg\"" do
|
|
@@ -8,7 +8,7 @@ describe Jpmobile::Mobile::Iphone do
|
|
|
8
8
|
request.stub(:user_agent) {'Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_4 like Mac OS X; ja-jp) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8K2 Safari/6533.18.5'}
|
|
9
9
|
|
|
10
10
|
mobile = Jpmobile::Mobile::Iphone.new({}, request)
|
|
11
|
-
mobile.unicode_emoticon?.should
|
|
11
|
+
mobile.unicode_emoticon?.should be_falsey
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
|
|
@@ -18,7 +18,7 @@ describe Jpmobile::Mobile::Iphone do
|
|
|
18
18
|
request.stub(:user_agent) {'Mozilla/5.0 (iPhone; CPU iPhone OS 5_1_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B206 Safari/7534.48.3'}
|
|
19
19
|
|
|
20
20
|
mobile = Jpmobile::Mobile::Iphone.new({}, request)
|
|
21
|
-
mobile.unicode_emoticon?.should
|
|
21
|
+
mobile.unicode_emoticon?.should be_truthy
|
|
22
22
|
end
|
|
23
23
|
end
|
|
24
24
|
|
|
@@ -28,7 +28,7 @@ describe Jpmobile::Mobile::Iphone do
|
|
|
28
28
|
request.stub(:user_agent) {'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A403 Safari/8536.25'}
|
|
29
29
|
|
|
30
30
|
mobile = Jpmobile::Mobile::Iphone.new({}, request)
|
|
31
|
-
mobile.unicode_emoticon?.should
|
|
31
|
+
mobile.unicode_emoticon?.should be_truthy
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
end
|
data/spec/unit/spec_helper.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
require 'rubygems'
|
|
2
2
|
require 'rspec'
|
|
3
|
+
require 'rspec/its'
|
|
3
4
|
$LOAD_PATH.unshift(File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib')))
|
|
4
5
|
require 'jpmobile'
|
|
5
6
|
begin
|
|
@@ -13,10 +14,13 @@ rescue LoadError
|
|
|
13
14
|
puts "Terminal display information test requires jpmobile-terminfo module"
|
|
14
15
|
end
|
|
15
16
|
|
|
16
|
-
RSpec.configure do |
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
RSpec.configure do |config|
|
|
18
|
+
config.filter_run :focus => true
|
|
19
|
+
config.run_all_when_everything_filtered = true
|
|
20
|
+
config.color = true
|
|
21
|
+
config.filter_run_excluding :broken => true
|
|
22
|
+
config.expect_with :rspec do |c|
|
|
23
|
+
c.syntax = [:should, :expect]
|
|
24
|
+
end
|
|
25
|
+
# config.full_backtrace = true
|
|
22
26
|
end
|
data/spec/unit/util_spec.rb
CHANGED
|
@@ -136,12 +136,12 @@ describe Jpmobile::Util do
|
|
|
136
136
|
describe 'check_charset' do
|
|
137
137
|
it 'returns true if compatible' do
|
|
138
138
|
str = 'ABC'.force_encoding('ASCII-8BIT')
|
|
139
|
-
check_charset(str, 'UTF-8').should
|
|
139
|
+
check_charset(str, 'UTF-8').should be_truthy
|
|
140
140
|
end
|
|
141
141
|
|
|
142
142
|
it 'returns false if incompatible' do
|
|
143
143
|
str = '再現'.encode('ISO-2022-JP')
|
|
144
|
-
check_charset(str, 'UTF-8').should
|
|
144
|
+
check_charset(str, 'UTF-8').should be_falsey
|
|
145
145
|
end
|
|
146
146
|
end
|
|
147
147
|
|
data/test/rails/overrides/.rspec
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
require File.expand_path(File.join(File.dirname(__FILE__), '/../spec_helper'))
|
|
1
|
+
require 'rails_helper'
|
|
3
2
|
|
|
4
3
|
describe MobileSpecController do
|
|
5
4
|
render_views
|
|
@@ -12,7 +11,7 @@ describe MobileSpecController do
|
|
|
12
11
|
|
|
13
12
|
response.should be_success
|
|
14
13
|
response.should render_template('index')
|
|
15
|
-
request.mobile?.should
|
|
14
|
+
request.mobile?.should be_falsey
|
|
16
15
|
end
|
|
17
16
|
end
|
|
18
17
|
|
|
@@ -22,7 +21,7 @@ describe MobileSpecController do
|
|
|
22
21
|
get 'index'
|
|
23
22
|
response.should be_success
|
|
24
23
|
response.should render_template('index_mobile')
|
|
25
|
-
request.mobile?.should
|
|
24
|
+
request.mobile?.should be_truthy
|
|
26
25
|
request.mobile.should be_a(Jpmobile::Mobile::Docomo)
|
|
27
26
|
end
|
|
28
27
|
end
|
|
@@ -36,7 +35,7 @@ describe MobileSpecController do
|
|
|
36
35
|
|
|
37
36
|
response.should be_success
|
|
38
37
|
response.body.should match('The change you wanted was rejected')
|
|
39
|
-
request.mobile?.should
|
|
38
|
+
request.mobile?.should be_falsey
|
|
40
39
|
end
|
|
41
40
|
end
|
|
42
41
|
|
|
@@ -47,7 +46,7 @@ describe MobileSpecController do
|
|
|
47
46
|
|
|
48
47
|
response.should be_success
|
|
49
48
|
response.body.should match('The change you wanted was rejected')
|
|
50
|
-
request.mobile?.should
|
|
49
|
+
request.mobile?.should be_truthy
|
|
51
50
|
request.mobile.should be_a(Jpmobile::Mobile::Docomo)
|
|
52
51
|
end
|
|
53
52
|
end
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
require File.expand_path(File.join(File.dirname(__FILE__), '/../spec_helper'))
|
|
1
|
+
require 'rails_helper'
|
|
3
2
|
|
|
4
3
|
describe MobileMailer do
|
|
5
4
|
include Jpmobile::Util
|
|
@@ -19,7 +18,7 @@ describe MobileMailer do
|
|
|
19
18
|
email = MobileMailer.view_selection(@to, "題名", "本文").deliver
|
|
20
19
|
|
|
21
20
|
ActionMailer::Base.deliveries.size.should == 1
|
|
22
|
-
email.to.include?(@to).should
|
|
21
|
+
email.to.include?(@to).should be_truthy
|
|
23
22
|
end
|
|
24
23
|
|
|
25
24
|
it "ISO-2022-JPに変換されること" do
|
|
@@ -450,8 +449,8 @@ describe MobileMailer, " mail address" do
|
|
|
450
449
|
|
|
451
450
|
emails = ActionMailer::Base.deliveries
|
|
452
451
|
emails.size.should == 1
|
|
453
|
-
emails.first.to.include?(to).should
|
|
454
|
-
emails.first.destinations.include?(to).should
|
|
452
|
+
emails.first.to.include?(to).should be_truthy
|
|
453
|
+
emails.first.destinations.include?(to).should be_truthy
|
|
455
454
|
end
|
|
456
455
|
|
|
457
456
|
it "@マークの直前にピリオドあるアドレスが有効になること" do
|
|
@@ -460,8 +459,8 @@ describe MobileMailer, " mail address" do
|
|
|
460
459
|
|
|
461
460
|
emails = ActionMailer::Base.deliveries
|
|
462
461
|
emails.size.should == 1
|
|
463
|
-
emails.first.to.include?(to).should
|
|
464
|
-
emails.first.destinations.include?(to).should
|
|
462
|
+
emails.first.to.include?(to).should be_truthy
|
|
463
|
+
emails.first.destinations.include?(to).should be_truthy
|
|
465
464
|
end
|
|
466
465
|
|
|
467
466
|
it "ピリオドから始まるアドレスが有効になること" do
|
|
@@ -470,8 +469,8 @@ describe MobileMailer, " mail address" do
|
|
|
470
469
|
|
|
471
470
|
emails = ActionMailer::Base.deliveries
|
|
472
471
|
emails.size.should == 1
|
|
473
|
-
emails.first.to.include?(to).should
|
|
474
|
-
emails.first.destinations.include?(to).should
|
|
472
|
+
emails.first.to.include?(to).should be_truthy
|
|
473
|
+
emails.first.destinations.include?(to).should be_truthy
|
|
475
474
|
end
|
|
476
475
|
|
|
477
476
|
it "複数のアドレスが有効になること" do
|
|
@@ -744,7 +743,7 @@ describe MobileMailer, "receiving" do
|
|
|
744
743
|
|
|
745
744
|
email.parts.first.body.should match(/カレンダーだ/)
|
|
746
745
|
|
|
747
|
-
email.has_attachments?.should
|
|
746
|
+
email.has_attachments?.should be_truthy
|
|
748
747
|
email.attachments.size.should == 1
|
|
749
748
|
email.attachments['20098calendar01.jpg'].content_type.should match("image/jpeg")
|
|
750
749
|
email.attachments['20098calendar01.jpg'].body.to_s[2..6] == "JFIF"
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
|
2
|
+
ENV["RAILS_ENV"] ||= 'test'
|
|
3
|
+
require 'spec_helper'
|
|
4
|
+
require File.expand_path("../../config/environment", __FILE__)
|
|
5
|
+
require 'rspec/rails'
|
|
6
|
+
# require 'capybara/rails'
|
|
7
|
+
# require 'capybara/rspec'
|
|
8
|
+
|
|
9
|
+
# Requires supporting ruby files with custom matchers and macros, etc, in
|
|
10
|
+
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
|
|
11
|
+
# run as spec files by default. This means that files in spec/support that end
|
|
12
|
+
# in _spec.rb will both be required and run as specs, causing the specs to be
|
|
13
|
+
# run twice. It is recommended that you do not name files matching this glob to
|
|
14
|
+
# end with _spec.rb. You can configure this pattern with with the --pattern
|
|
15
|
+
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
|
|
16
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
|
17
|
+
|
|
18
|
+
# Checks for pending migrations before tests are run.
|
|
19
|
+
# If you are not using ActiveRecord, you can remove this line.
|
|
20
|
+
ActiveRecord::Migration.maintain_test_schema!
|
|
21
|
+
|
|
22
|
+
RSpec.configure do |config|
|
|
23
|
+
# config.mock_with :rspec
|
|
24
|
+
|
|
25
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
|
26
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
|
27
|
+
|
|
28
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
|
29
|
+
# examples within a transaction, remove the following line or assign false
|
|
30
|
+
# instead of true.
|
|
31
|
+
config.use_transactional_fixtures = true
|
|
32
|
+
config.include Jpmobile::Util
|
|
33
|
+
config.include Capybara::DSL
|
|
34
|
+
|
|
35
|
+
# RSpec Rails can automatically mix in different behaviours to your tests
|
|
36
|
+
# based on their file location, for example enabling you to call `get` and
|
|
37
|
+
# `post` in specs under `spec/controllers`.
|
|
38
|
+
#
|
|
39
|
+
# You can disable this behaviour by removing the line below, and instead
|
|
40
|
+
# explicitly tag your specs with their type, e.g.:
|
|
41
|
+
#
|
|
42
|
+
# RSpec.describe UsersController, :type => :controller do
|
|
43
|
+
# # ...
|
|
44
|
+
# end
|
|
45
|
+
#
|
|
46
|
+
# The different available types are documented in the features, such as in
|
|
47
|
+
# https://relishapp.com/rspec/rspec-rails/docs
|
|
48
|
+
config.infer_spec_type_from_file_location!
|
|
49
|
+
|
|
50
|
+
config.filter_run focus: true
|
|
51
|
+
config.run_all_when_everything_filtered = true
|
|
52
|
+
config.color = true
|
|
53
|
+
config.filter_run_excluding broken: true
|
|
54
|
+
# config.full_backtrace = true
|
|
55
|
+
config.expect_with :rspec do |c|
|
|
56
|
+
c.syntax = [:should, :expect]
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
require 'pp'
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
require File.expand_path(File.join(File.dirname(__FILE__), '/../spec_helper'))
|
|
1
|
+
require 'rails_helper'
|
|
3
2
|
|
|
4
3
|
describe "DoCoMo SH902i からのアクセス" do
|
|
5
4
|
it "request.mobile は Docomo のインスタンスであるべき" do
|
|
@@ -10,7 +9,7 @@ describe "DoCoMo SH902i からのアクセス" do
|
|
|
10
9
|
it "request.mobile? は true であるべき" do
|
|
11
10
|
get "/mobile_spec/index", {}, {"HTTP_USER_AGENT" => "DoCoMo/2.0 SH902i(c100;TB;W24H12)"}
|
|
12
11
|
|
|
13
|
-
request.mobile?.should
|
|
12
|
+
request.mobile?.should be_truthy
|
|
14
13
|
end
|
|
15
14
|
end
|
|
16
15
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
require File.expand_path(File.join(File.dirname(__FILE__), '/../spec_helper'))
|
|
1
|
+
require 'rails_helper'
|
|
3
2
|
|
|
4
3
|
describe "H11T モバイルブラウザからのアクセス" do
|
|
5
4
|
before do
|
|
@@ -18,7 +17,7 @@ describe "H11T モバイルブラウザからのアクセス" do
|
|
|
18
17
|
it "request.mobile? は true であること" do
|
|
19
18
|
get "/mobile_spec/index", {}, @headers
|
|
20
19
|
|
|
21
|
-
request.mobile?.should
|
|
20
|
+
request.mobile?.should be_truthy
|
|
22
21
|
end
|
|
23
22
|
it "のsubscribe番号を取得できること" do
|
|
24
23
|
get "/mobile_spec/index", {}, @headers
|
|
@@ -28,7 +27,7 @@ describe "H11T モバイルブラウザからのアクセス" do
|
|
|
28
27
|
it "のIPアドレス空間を正しく検証できること" do
|
|
29
28
|
get "/mobile_spec/index", {}, @headers
|
|
30
29
|
|
|
31
|
-
request.mobile.valid_ip?.should
|
|
30
|
+
request.mobile.valid_ip?.should be_truthy
|
|
32
31
|
end
|
|
33
32
|
end
|
|
34
33
|
|
|
@@ -47,6 +46,6 @@ describe "S11HT からのアクセス" do
|
|
|
47
46
|
it "request.mobile? は true であること" do
|
|
48
47
|
get "/mobile_spec/index", {}, @headers
|
|
49
48
|
|
|
50
|
-
request.mobile?.should
|
|
49
|
+
request.mobile?.should be_truthy
|
|
51
50
|
end
|
|
52
51
|
end
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
require File.expand_path(File.join(File.dirname(__FILE__), '/../spec_helper'))
|
|
1
|
+
require 'rails_helper'
|
|
3
2
|
|
|
4
3
|
describe "PCからのアクセスの場合" do
|
|
5
4
|
before do
|
|
@@ -16,6 +15,6 @@ describe "PCからのアクセスの場合" do
|
|
|
16
15
|
it "request.mobile? は false であるべき" do
|
|
17
16
|
get "/mobile_spec/index", {}, @headers
|
|
18
17
|
|
|
19
|
-
request.mobile?.should
|
|
18
|
+
request.mobile?.should be_falsey
|
|
20
19
|
end
|
|
21
20
|
end
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
require File.expand_path(File.join(File.dirname(__FILE__), '/../spec_helper'))
|
|
1
|
+
require 'rails_helper'
|
|
3
2
|
|
|
4
3
|
describe "Softbank Emulator からのアクセスのとき" do
|
|
5
4
|
it "request.mobile は Softbank のインスタンスであること" do
|
|
6
5
|
get "/mobile_spec/index", {}, {"HTTP_USER_AGENT" => "Semulator"}
|
|
7
6
|
|
|
8
7
|
request.mobile.should be_an_instance_of(Jpmobile::Mobile::Softbank)
|
|
9
|
-
request.mobile?.should
|
|
8
|
+
request.mobile?.should be_truthy
|
|
10
9
|
end
|
|
11
10
|
end
|
|
12
11
|
|
|
@@ -15,6 +14,6 @@ describe "Vodafone Emulator からのアクセスのとき" do
|
|
|
15
14
|
get "/mobile_spec/index", {}, {"HTTP_USER_AGENT" => "Vemulator"}
|
|
16
15
|
|
|
17
16
|
request.mobile.should be_an_instance_of(Jpmobile::Mobile::Vodafone)
|
|
18
|
-
request.mobile?.should
|
|
17
|
+
request.mobile?.should be_truthy
|
|
19
18
|
end
|
|
20
19
|
end
|
|
@@ -1,39 +1,78 @@
|
|
|
1
|
-
# This file
|
|
2
|
-
#
|
|
3
|
-
|
|
4
|
-
require
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
# This file was generated by the `rails generate rspec:install` command. Conventionally, all
|
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
|
3
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause this
|
|
4
|
+
# file to always be loaded, without a need to explicitly require it in any files.
|
|
5
|
+
#
|
|
6
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
|
7
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
|
8
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
|
9
|
+
# individual file that may not need all of that loaded. Instead, make a
|
|
10
|
+
# separate helper file that requires this one and then use it only in the specs
|
|
11
|
+
# that actually need it.
|
|
12
|
+
#
|
|
13
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
|
14
|
+
# users commonly want.
|
|
15
|
+
#
|
|
16
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
|
17
|
+
RSpec.configure do |config|
|
|
18
|
+
# The settings below are suggested to provide a good initial experience
|
|
19
|
+
# with RSpec, but feel free to customize to your heart's content.
|
|
20
|
+
=begin
|
|
21
|
+
# These two settings work together to allow you to limit a spec run
|
|
22
|
+
# to individual examples or groups you care about by tagging them with
|
|
23
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
|
24
|
+
# get run.
|
|
25
|
+
config.filter_run :focus
|
|
26
|
+
config.run_all_when_everything_filtered = true
|
|
8
27
|
|
|
9
|
-
#
|
|
10
|
-
#
|
|
11
|
-
|
|
28
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
|
29
|
+
# file, and it's useful to allow more verbose output when running an
|
|
30
|
+
# individual spec file.
|
|
31
|
+
if config.files_to_run.one?
|
|
32
|
+
# Use the documentation formatter for detailed output,
|
|
33
|
+
# unless a formatter has already been configured
|
|
34
|
+
# (e.g. via a command-line flag).
|
|
35
|
+
config.default_formatter = 'doc'
|
|
36
|
+
end
|
|
12
37
|
|
|
13
|
-
|
|
14
|
-
#
|
|
15
|
-
#
|
|
16
|
-
|
|
17
|
-
#
|
|
18
|
-
# config.mock_with :mocha
|
|
19
|
-
# config.mock_with :flexmock
|
|
20
|
-
# config.mock_with :rr
|
|
21
|
-
config.mock_with :rspec
|
|
38
|
+
# Print the 10 slowest examples and example groups at the
|
|
39
|
+
# end of the spec run, to help surface which specs are running
|
|
40
|
+
# particularly slow.
|
|
41
|
+
config.profile_examples = 10
|
|
22
42
|
|
|
23
|
-
|
|
43
|
+
# Run specs in random order to surface order dependencies. If you find an
|
|
44
|
+
# order dependency and want to debug it, you can fix the order by providing
|
|
45
|
+
# the seed, which is printed after each run.
|
|
46
|
+
# --seed 1234
|
|
47
|
+
config.order = :random
|
|
24
48
|
|
|
25
|
-
#
|
|
26
|
-
#
|
|
27
|
-
#
|
|
28
|
-
|
|
29
|
-
config.
|
|
30
|
-
config.include Capybara::DSL
|
|
49
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
|
50
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
|
51
|
+
# test failures related to randomization by passing the same `--seed` value
|
|
52
|
+
# as the one that triggered the failure.
|
|
53
|
+
Kernel.srand config.seed
|
|
31
54
|
|
|
32
|
-
config.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
config.
|
|
36
|
-
|
|
37
|
-
|
|
55
|
+
# rspec-expectations config goes here. You can use an alternate
|
|
56
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
|
57
|
+
# assertions if you prefer.
|
|
58
|
+
config.expect_with :rspec do |expectations|
|
|
59
|
+
# Enable only the newer, non-monkey-patching expect syntax.
|
|
60
|
+
# For more details, see:
|
|
61
|
+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
|
62
|
+
expectations.syntax = :expect
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
|
66
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
|
67
|
+
config.mock_with :rspec do |mocks|
|
|
68
|
+
# Enable only the newer, non-monkey-patching expect syntax.
|
|
69
|
+
# For more details, see:
|
|
70
|
+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
|
71
|
+
mocks.syntax = :expect
|
|
38
72
|
|
|
39
|
-
|
|
73
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
|
74
|
+
# a real object. This is generally recommended.
|
|
75
|
+
mocks.verify_partial_doubles = true
|
|
76
|
+
end
|
|
77
|
+
=end
|
|
78
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jpmobile
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.1.
|
|
4
|
+
version: 4.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Shin-ichiro OGAWA
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2014-
|
|
12
|
+
date: 2014-06-27 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|
|
@@ -53,6 +53,20 @@ dependencies:
|
|
|
53
53
|
- - ">="
|
|
54
54
|
- !ruby/object:Gem::Version
|
|
55
55
|
version: '0'
|
|
56
|
+
- !ruby/object:Gem::Dependency
|
|
57
|
+
name: rspec-its
|
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
|
59
|
+
requirements:
|
|
60
|
+
- - ">="
|
|
61
|
+
- !ruby/object:Gem::Version
|
|
62
|
+
version: '0'
|
|
63
|
+
type: :development
|
|
64
|
+
prerelease: false
|
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
66
|
+
requirements:
|
|
67
|
+
- - ">="
|
|
68
|
+
- !ruby/object:Gem::Version
|
|
69
|
+
version: '0'
|
|
56
70
|
- !ruby/object:Gem::Dependency
|
|
57
71
|
name: capybara-webkit
|
|
58
72
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -359,6 +373,7 @@ files:
|
|
|
359
373
|
- test/rails/overrides/spec/mailers/decorated_mailer_spec.rb
|
|
360
374
|
- test/rails/overrides/spec/mailers/mobile_mailer_spec.rb
|
|
361
375
|
- test/rails/overrides/spec/mailers/normal_mailer_spec.rb
|
|
376
|
+
- test/rails/overrides/spec/rails_helper.rb
|
|
362
377
|
- test/rails/overrides/spec/rcov.opts
|
|
363
378
|
- test/rails/overrides/spec/requests/docomo_spec.rb
|
|
364
379
|
- test/rails/overrides/spec/requests/emobile_spec.rb
|
|
@@ -567,6 +582,7 @@ test_files:
|
|
|
567
582
|
- test/rails/overrides/spec/mailers/decorated_mailer_spec.rb
|
|
568
583
|
- test/rails/overrides/spec/mailers/mobile_mailer_spec.rb
|
|
569
584
|
- test/rails/overrides/spec/mailers/normal_mailer_spec.rb
|
|
585
|
+
- test/rails/overrides/spec/rails_helper.rb
|
|
570
586
|
- test/rails/overrides/spec/rcov.opts
|
|
571
587
|
- test/rails/overrides/spec/requests/docomo_spec.rb
|
|
572
588
|
- test/rails/overrides/spec/requests/emobile_spec.rb
|