jpmobile 4.0.1 → 4.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,334 +1,257 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require File.expand_path(File.join(File.dirname(__FILE__), '/../spec_helper'))
3
3
 
4
- #
5
- # 携帯からのアクセス
6
- #
7
- describe TemplatePathController, "DoCoMo SH902i からのアクセス" do
8
- before do
9
- @user_agent = "DoCoMo/2.0 SH902i(c100;TB;W24H12)"
10
- end
11
-
12
- it 'テンプレートの探索順が正しいこと' do
13
- get "/template_path/index", {}, { "HTTP_USER_AGENT" => @user_agent}
14
-
15
- controller.lookup_context.mobile.should == [ 'mobile_docomo', 'mobile' ]
16
- end
17
- end
18
-
19
- describe TemplatePathController, "au CA32 からのアクセス" do
20
- before do
21
- @user_agent = "KDDI-CA32 UP.Browser/6.2.0.7.3.129 (GUI) MMP/2.0"
22
- end
23
- it 'テンプレートの探索順が正しいこと' do
24
- get "/template_path/index", {}, { "HTTP_USER_AGENT" => @user_agent}
25
-
26
- controller.lookup_context.mobile.should == [ 'mobile_au', 'mobile' ]
27
- end
28
- end
29
-
30
- describe TemplatePathController, "Vodafone V903T からのアクセス" do
31
- before do
32
- @user_agent = "Vodafone/1.0/V903T/TJ001 Browser/VF-Browser/1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 Ext-J-Profile/JSCL-1.2.2 Ext-V-Profile/VSCL-2.0.0"
33
- end
34
- it 'テンプレートの探索順が正しいこと' do
35
- get "/template_path/index", {}, { "HTTP_USER_AGENT" => @user_agent}
36
-
37
- controller.lookup_context.mobile.should == [ 'mobile_vodafone', 'mobile_softbank', 'mobile' ]
38
- end
39
- end
40
-
41
- describe TemplatePathController, "SoftBank 910T からのアクセス" do
42
- before do
43
- @user_agent = "SoftBank/1.0/910T/TJ001/SN000000000000000 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1"
44
- end
45
- it 'テンプレートの探索順が正しいこと' do
46
- get "/template_path/index", {}, { "HTTP_USER_AGENT" => @user_agent}
47
-
48
- controller.lookup_context.mobile.should == [ 'mobile_softbank', 'mobile' ]
49
- end
50
- end
51
-
52
- describe TemplatePathController, "iPhone からのアクセス" do
53
- before do
54
- @user_agent = 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; ja-jp) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16'
55
- end
56
- it 'テンプレートの探索順が正しいこと' do
57
- get "/template_path/index", {}, { "HTTP_USER_AGENT" => @user_agent}
58
-
59
- controller.lookup_context.mobile.should == [ 'smart_phone_iphone', 'smart_phone' ]
60
- end
61
- end
62
-
63
- describe TemplatePathController, "Android からのアクセス" do
64
- before do
65
- @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'
66
- end
67
- it 'テンプレートの探索順が正しいこと' do
68
- get "/template_path/index", {}, { "HTTP_USER_AGENT" => @user_agent}
69
-
70
- controller.lookup_context.mobile.should == [ 'smart_phone_android', 'smart_phone' ]
71
- end
72
- end
73
-
74
- describe TemplatePathController, "Windows Phone からのアクセス" do
4
+ describe TemplatePathController, "integrated_views" do
75
5
  before do
76
- @user_agent = 'Mozilla/4.0 (Compatible; MSIE 6.0; Windows NT 5.1 T-01A_6.5; Windows Phone 6.5)'
6
+ page.driver.header('User-Agent', user_agent)
77
7
  end
78
- it 'テンプレートの探索順が正しいこと' do
79
- get "/template_path/index", {}, { "HTTP_USER_AGENT" => @user_agent}
80
8
 
81
- controller.lookup_context.mobile.should == [ 'smart_phone_windows_phone', 'smart_phone' ]
82
- end
83
- end
84
-
85
- describe TemplatePathController, "integrated_views" do
86
9
  describe "index" do
87
10
  context "PCからのアクセスの場合" do
88
- before do
89
- @user_agent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322)"
11
+ let(:user_agent) do
12
+ "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322)"
90
13
  end
91
14
  it 'index.html.erbが使用されること' do
92
- get "/template_path/index", {}, { "HTTP_USER_AGENT" => @user_agent}
15
+ visit "/template_path/index"
93
16
 
94
- response.should have_tag("h1", :content => "index.html.erb")
17
+ page.should have_content("index.html.erb")
95
18
  end
96
19
  end
97
20
 
98
21
  context "DoCoMoからのアクセスの場合" do
99
- before do
100
- @user_agent = "DoCoMo/2.0 SH902i(c100;TB;W24H12)"
22
+ let(:user_agent) do
23
+ "DoCoMo/2.0 SH902i(c100;TB;W24H12)"
101
24
  end
102
25
  it 'index_mobile_docomo.html.erbが使用されること' do
103
- get "/template_path/index", {}, { "HTTP_USER_AGENT" => @user_agent}
26
+ visit "/template_path/index"
104
27
 
105
- response.should have_tag("h1", :content => "index_mobile_docomo.html.erb")
28
+ page.should have_content("index_mobile_docomo.html.erb")
106
29
  end
107
30
 
108
31
  it 'show.html.erb がなくとも show_mobile_docomo.html.erbが使用されること' do
109
- get "/template_path/show", {}, { "HTTP_USER_AGENT" => @user_agent}
32
+ visit "/template_path/show"
110
33
 
111
- response.should have_tag("h1", :content => "show_mobile_docomo.html.erb")
34
+ page.should have_content("show_mobile_docomo.html.erb")
112
35
  end
113
36
 
114
37
  it 'disable_mobile_view! のときには index.html.erb が使用されること' do
115
- get "/template_path/index", {:pc => true}, { "HTTP_USER_AGENT" => @user_agent}
38
+ visit "/template_path/index?pc=true"
116
39
 
117
- response.should have_tag("h1", :content => "index.html.erb")
40
+ page.should have_content("index.html.erb")
118
41
  end
119
42
  end
120
43
 
121
44
  context "SoftBankからのアクセスの場合" do
122
- before do
123
- @user_agent = "SoftBank/1.0/910T/TJ001/SN000000000000000 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1"
45
+ let(:user_agent) do
46
+ "SoftBank/1.0/910T/TJ001/SN000000000000000 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1"
124
47
  end
125
48
  it 'index_mobile.html.erbが使用されること' do
126
- get "/template_path/index", {}, { "HTTP_USER_AGENT" => @user_agent}
49
+ visit "/template_path/index"
127
50
 
128
- response.should have_tag("h1", :content => "index_mobile.html.erb")
51
+ page.should have_content("index_mobile.html.erb")
129
52
  end
130
53
 
131
54
  it 'show.html.erb がなくとも show_mobile.html.erbが使用されること' do
132
- get "/template_path/show", {}, { "HTTP_USER_AGENT" => @user_agent}
55
+ visit "/template_path/show"
133
56
 
134
- response.should have_tag("h1", :content => "show_mobile.html.erb")
57
+ page.should have_content("show_mobile.html.erb")
135
58
  end
136
59
  end
137
60
 
138
61
  context "iPhoneからのアクセスの場合" do
139
- before do
140
- @user_agent = 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; ja-jp) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16'
62
+ let(:user_agent) do
63
+ 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; ja-jp) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16'
141
64
  end
142
65
  it 'smart_phone_iphone.html.erbが使用されること' do
143
- get "/template_path/index", {}, { "HTTP_USER_AGENT" => @user_agent}
66
+ visit "/template_path/index"
144
67
 
145
- response.should have_tag("h1", :content => "smart_phone_iphone.html.erb")
68
+ page.should have_content("smart_phone_iphone.html.erb")
146
69
  end
147
70
  end
148
71
 
149
72
  context "Androidからのアクセスの場合" do
150
- before do
151
- @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'
73
+ let(:user_agent) do
74
+ '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'
152
75
  end
153
76
  it 'smart_phone.html.erbが使用されること' do
154
- get "/template_path/index", {}, { "HTTP_USER_AGENT" => @user_agent}
77
+ visit "/template_path/index"
155
78
 
156
- response.should have_tag("h1", :content => "smart_phone.html.erb")
79
+ page.should have_content("smart_phone.html.erb")
157
80
  end
158
81
  end
159
82
 
160
83
  context "Windows Phoneからのアクセスの場合" do
161
- before do
162
- @user_agent = 'Mozilla/4.0 (Compatible; MSIE 6.0; Windows NT 5.1 T-01A_6.5; Windows Phone 6.5)'
84
+ let(:user_agent) do
85
+ 'Mozilla/4.0 (Compatible; MSIE 6.0; Windows NT 5.1 T-01A_6.5; Windows Phone 6.5)'
163
86
  end
164
87
  it 'smart_phone.html.erbが使用されること' do
165
- get "/template_path/index", {}, { "HTTP_USER_AGENT" => @user_agent}
88
+ visit "/template_path/index"
166
89
 
167
- response.should have_tag("h1", :content => "smart_phone.html.erb")
90
+ page.should have_content("smart_phone.html.erb")
168
91
  end
169
92
  end
170
93
  end
171
94
 
172
95
  context 'only smart_phone view' do
173
96
  context 'iPadからのアクセスの場合' do
174
- before do
175
- @user_agent = 'Mozilla/5.0 (iPad; U; CPU OS 4_3 like Mac OS X; ja-jp) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8F191 Safari/6533.18.5'
97
+ let(:user_agent) do
98
+ 'Mozilla/5.0 (iPad; U; CPU OS 4_3 like Mac OS X; ja-jp) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8F191 Safari/6533.18.5'
176
99
  end
177
100
  it 'smart_phone_only.html.erbが使用されること' do
178
- get '/template_path/smart_phone_only', {}, {'HTTP_USER_AGENT' => @user_agent}
101
+ visit '/template_path/smart_phone_only'
179
102
 
180
- response.should have_tag('h1', :content => 'smart_phone_only_smart_phone.html.erb')
103
+ page.should have_content('smart_phone_only_smart_phone.html.erb')
181
104
  end
182
105
  end
183
106
 
184
107
  context 'Android Tabletからのアクセスの場合' do
185
- before do
186
- @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'
108
+ let(:user_agent) do
109
+ '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'
187
110
  end
188
111
  it 'smart_phone_only.html.erbが使用されること' do
189
- get '/template_path/smart_phone_only', {}, {'HTTP_USER_AGENT' => @user_agent}
112
+ visit '/template_path/smart_phone_only'
190
113
 
191
- response.should have_tag('h1', :content => 'smart_phone_only_smart_phone.html.erb')
114
+ page.should have_content('smart_phone_only_smart_phone.html.erb')
192
115
  end
193
116
  end
194
117
  end
195
118
 
196
119
  context 'with_tblt view' do
197
120
  context 'iPadからのアクセスの場合' do
198
- before do
199
- @user_agent = 'Mozilla/5.0 (iPad; U; CPU OS 4_3 like Mac OS X; ja-jp) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8F191 Safari/6533.18.5'
121
+ let(:user_agent) do
122
+ 'Mozilla/5.0 (iPad; U; CPU OS 4_3 like Mac OS X; ja-jp) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8F191 Safari/6533.18.5'
200
123
  end
201
124
  it 'with_tblt_tablet.html.erbが使用されること' do
202
- get '/template_path/with_tblt', {}, {'HTTP_USER_AGENT' => @user_agent}
125
+ visit '/template_path/with_tblt'
203
126
 
204
- response.should have_tag('h1', :content => 'with_tblt_tablet.html.erb')
127
+ page.should have_content('with_tblt_tablet.html.erb')
205
128
  end
206
129
  end
207
130
 
208
131
  context 'Android Tabletからのアクセスの場合' do
209
- before do
210
- @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'
132
+ let(:user_agent) do
133
+ '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'
211
134
  end
212
135
  it 'with_tblt_tablet.html.erbが使用されること' do
213
- get '/template_path/with_tblt', {}, {'HTTP_USER_AGENT' => @user_agent}
136
+ visit '/template_path/with_tblt'
214
137
 
215
- response.should have_tag('h1', :content => 'with_tblt_tablet.html.erb')
138
+ page.should have_content('with_tblt_tablet.html.erb')
216
139
  end
217
140
  end
218
141
  end
219
142
 
220
143
  context 'with_ipd view' do
221
144
  context 'iPadからのアクセスの場合' do
222
- before do
223
- @user_agent = 'Mozilla/5.0 (iPad; U; CPU OS 4_3 like Mac OS X; ja-jp) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8F191 Safari/6533.18.5'
145
+ let(:user_agent) do
146
+ 'Mozilla/5.0 (iPad; U; CPU OS 4_3 like Mac OS X; ja-jp) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8F191 Safari/6533.18.5'
224
147
  end
225
148
  it 'with_ipd_tablet_ipad.html.erbが使用されること' do
226
- get '/template_path/with_ipd', {}, {'HTTP_USER_AGENT' => @user_agent}
149
+ visit '/template_path/with_ipd'
227
150
 
228
- response.should have_tag('h1', :content => 'with_ipd_tablet_ipad.html.erb')
151
+ page.should have_content('with_ipd_tablet_ipad.html.erb')
229
152
  end
230
153
  end
231
154
 
232
155
  context 'Android Tabletからのアクセスの場合' do
233
- before do
234
- @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'
156
+ let(:user_agent) do
157
+ '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'
235
158
  end
236
159
  it 'with_ipd.html.erbが使用されること' do
237
- get '/template_path/with_ipd', {}, {'HTTP_USER_AGENT' => @user_agent}
160
+ visit '/template_path/with_ipd'
238
161
 
239
- response.should have_tag('h1', :content => 'with_ipd.html.erb')
162
+ page.should have_content('with_ipd.html.erb')
240
163
  end
241
164
  end
242
165
  end
243
166
 
244
167
  context "partial" do
245
168
  context "PCからのアクセスの場合" do
246
- before do
247
- @user_agent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322)"
169
+ let(:user_agent) do
170
+ "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322)"
248
171
  end
249
172
  it '_partial.html.erbが使用されること' do
250
- get "/template_path/partial", {}, { "HTTP_USER_AGENT" => @user_agent}
173
+ visit "/template_path/partial"
251
174
 
252
- response.should have_tag("h2", :content => "_partial.html.erb")
175
+ page.should have_content("_partial.html.erb")
253
176
  end
254
177
  end
255
178
 
256
179
  context "DoCoMoからのアクセスの場合" do
257
- before do
258
- @user_agent = "DoCoMo/2.0 SH902i(c100;TB;W24H12)"
180
+ let(:user_agent) do
181
+ "DoCoMo/2.0 SH902i(c100;TB;W24H12)"
259
182
  end
260
183
  it '_partial_mobile_docomo.html.erbが使用されること' do
261
- get "/template_path/partial", {}, { "HTTP_USER_AGENT" => @user_agent}
184
+ visit "/template_path/partial"
262
185
 
263
- response.should have_tag("h2", :content => "_partial_mobile_docomo.html.erb")
186
+ page.should have_content("_partial_mobile_docomo.html.erb")
264
187
  end
265
188
  end
266
189
 
267
190
  context "SoftBankからのアクセスの場合" do
268
- before do
269
- @user_agent = "SoftBank/1.0/910T/TJ001/SN000000000000000 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1"
191
+ let(:user_agent) do
192
+ "SoftBank/1.0/910T/TJ001/SN000000000000000 Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1"
270
193
  end
271
194
  it '_partial_mobile.html.erbが使用されること' do
272
- get "/template_path/partial", {}, { "HTTP_USER_AGENT" => @user_agent}
195
+ visit "/template_path/partial"
273
196
 
274
- response.should have_tag("h2", :content => "_partial_mobile.html.erb")
197
+ page.should have_content("_partial_mobile.html.erb")
275
198
  end
276
199
  end
277
200
 
278
201
  context "iPhoneからのアクセスの場合" do
279
- before do
280
- @user_agent = 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; ja-jp) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16'
202
+ let(:user_agent) do
203
+ 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; ja-jp) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16'
281
204
  end
282
205
  it '_partial_smart_phone_iphone.html.erbが使用されること' do
283
- get "/template_path/partial", {}, { "HTTP_USER_AGENT" => @user_agent}
206
+ visit "/template_path/partial"
284
207
 
285
- response.should have_tag("h2", :content => "_partial_smart_phone_iphone.html.erb")
208
+ page.should have_content("_partial_smart_phone_iphone.html.erb")
286
209
  end
287
210
  end
288
211
 
289
212
  context "Androidからのアクセスの場合" do
290
- before do
291
- @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'
213
+ let(:user_agent) do
214
+ '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'
292
215
  end
293
216
  it '_partial_smart_phone.html.erbが使用されること' do
294
- get "/template_path/partial", {}, { "HTTP_USER_AGENT" => @user_agent}
217
+ visit "/template_path/partial"
295
218
 
296
- response.should have_tag("h2", :content => "_partial_smart_phone.html.erb")
219
+ page.should have_content("_partial_smart_phone.html.erb")
297
220
  end
298
221
  end
299
222
 
300
223
  context "Windows Phoneからのアクセスの場合" do
301
- before do
302
- @user_agent = 'Mozilla/4.0 (Compatible; MSIE 6.0; Windows NT 5.1 T-01A_6.5; Windows Phone 6.5)'
224
+ let(:user_agent) do
225
+ 'Mozilla/4.0 (Compatible; MSIE 6.0; Windows NT 5.1 T-01A_6.5; Windows Phone 6.5)'
303
226
  end
304
227
  it '_partial_smart_phone.html.erbが使用されること' do
305
- get "/template_path/partial", {}, { "HTTP_USER_AGENT" => @user_agent}
228
+ visit "/template_path/partial"
306
229
 
307
- response.should have_tag("h2", :content => "_partial_smart_phone.html.erb")
230
+ page.should have_content("_partial_smart_phone.html.erb")
308
231
  end
309
232
  end
310
233
  end
311
234
 
312
235
  context "full_path_partial" do
313
236
  context "PCからのアクセスの場合" do
314
- before do
315
- @user_agent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322)"
237
+ let(:user_agent) do
238
+ "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322)"
316
239
  end
317
240
  it '_partial.html.erbが使用されること' do
318
- get "/template_path/full_path_partial", {}, { "HTTP_USER_AGENT" => @user_agent}
241
+ visit "/template_path/full_path_partial"
319
242
 
320
- response.should have_tag("h2", :content => "_partial.html.erb")
243
+ page.should have_content("_partial.html.erb")
321
244
  end
322
245
  end
323
246
 
324
247
  context "DoCoMoからのアクセスの場合" do
325
- before do
326
- @user_agent = "DoCoMo/2.0 SH902i(c100;TB;W24H12)"
248
+ let(:user_agent) do
249
+ "DoCoMo/2.0 SH902i(c100;TB;W24H12)"
327
250
  end
328
251
  it '_partial_mobile_docomo.html.erbが使用されること' do
329
- get "/template_path/full_path_partial", {}, { "HTTP_USER_AGENT" => @user_agent}
252
+ visit "/template_path/full_path_partial"
330
253
 
331
- response.should have_tag("h2", :content => "_partial_mobile_docomo.html.erb")
254
+ page.should have_content("_partial_mobile_docomo.html.erb")
332
255
  end
333
256
  end
334
257
  end
@@ -3,6 +3,8 @@
3
3
  ENV["RAILS_ENV"] ||= 'test'
4
4
  require File.expand_path("../../config/environment", __FILE__)
5
5
  require 'rspec/rails'
6
+ require 'capybara/rails'
7
+ require 'capybara/rspec'
6
8
 
7
9
  # Requires supporting files with custom matchers and macros, etc,
8
10
  # in ./support/ and its subdirectories.
@@ -24,9 +26,8 @@ RSpec.configure do |config|
24
26
  # examples within a transaction, comment the following line or assign false
25
27
  # instead of true.
26
28
  config.use_transactional_fixtures = true
27
- config.include Webrat::HaveTagMatcher
28
29
  config.include Jpmobile::Util
29
- config.before(:each) { Webrat.configuration.mode = :rails }
30
+ config.include Capybara::DSL
30
31
 
31
32
  config.filter_run :focus => true
32
33
  config.run_all_when_everything_filtered = true
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.0.1
4
+ version: 4.1.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shin-ichiro OGAWA
@@ -9,132 +9,118 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-11-19 00:00:00.000000000 Z
12
+ date: 2014-02-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ~>
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 4.0.0
20
+ version: '0'
21
21
  type: :development
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ~>
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: 4.0.0
27
+ version: '0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rspec
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - '>='
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
34
  version: '0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - '>='
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rspec-rails
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - '>='
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - '>='
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  - !ruby/object:Gem::Dependency
57
- name: webrat
57
+ name: capybara-webkit
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - '>='
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - '>='
67
+ - - ">="
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: geokit
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - '>='
74
+ - - ">="
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - '>='
81
+ - - ">="
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: sqlite3-ruby
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - '>='
88
+ - - ">="
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - '>='
95
+ - - ">="
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
- - !ruby/object:Gem::Dependency
99
- name: nokogiri
100
- requirement: !ruby/object:Gem::Requirement
101
- requirements:
102
- - - '='
103
- - !ruby/object:Gem::Version
104
- version: 1.6.2.1
105
- type: :development
106
- prerelease: false
107
- version_requirements: !ruby/object:Gem::Requirement
108
- requirements:
109
- - - '='
110
- - !ruby/object:Gem::Version
111
- version: 1.6.2.1
112
98
  - !ruby/object:Gem::Dependency
113
99
  name: hpricot
114
100
  requirement: !ruby/object:Gem::Requirement
115
101
  requirements:
116
- - - '>='
102
+ - - ">="
117
103
  - !ruby/object:Gem::Version
118
104
  version: '0'
119
105
  type: :development
120
106
  prerelease: false
121
107
  version_requirements: !ruby/object:Gem::Requirement
122
108
  requirements:
123
- - - '>='
109
+ - - ">="
124
110
  - !ruby/object:Gem::Version
125
111
  version: '0'
126
112
  - !ruby/object:Gem::Dependency
127
113
  name: git
128
114
  requirement: !ruby/object:Gem::Requirement
129
115
  requirements:
130
- - - '>='
116
+ - - ">="
131
117
  - !ruby/object:Gem::Version
132
118
  version: '0'
133
119
  type: :development
134
120
  prerelease: false
135
121
  version_requirements: !ruby/object:Gem::Requirement
136
122
  requirements:
137
- - - '>='
123
+ - - ">="
138
124
  - !ruby/object:Gem::Version
139
125
  version: '0'
140
126
  description: A Rails plugin for mobile devices in Japan
@@ -144,17 +130,14 @@ executables: []
144
130
  extensions: []
145
131
  extra_rdoc_files: []
146
132
  files:
147
- - .gitignore
148
- - .rspec
149
- - CHANGELOG
133
+ - ".gitignore"
134
+ - ".rspec"
150
135
  - Gemfile
151
136
  - MIT-LICENSE
152
137
  - README
153
138
  - README.rdoc
154
139
  - Rakefile
155
- - VERSION.yml
156
140
  - init.rb
157
- - install.rb
158
141
  - jpmobile.gemspec
159
142
  - lib/jpmobile.rb
160
143
  - lib/jpmobile/configuration.rb
@@ -242,7 +225,6 @@ files:
242
225
  - spec/unit/email-fixtures/docomo-jis.eml
243
226
  - spec/unit/email-fixtures/iphone-mail3.eml
244
227
  - spec/unit/email-fixtures/iphone-message.eml
245
- - spec/unit/email-fixtures/pc-mail-attached-without-subject.eml
246
228
  - spec/unit/email-fixtures/pc-mail-multi.eml
247
229
  - spec/unit/email-fixtures/pc-mail-single.eml
248
230
  - spec/unit/email-fixtures/photo.jpg
@@ -348,8 +330,13 @@ files:
348
330
  - test/rails/overrides/config/routes.rb
349
331
  - test/rails/overrides/db/migrate/001_add_sessions_table.rb
350
332
  - test/rails/overrides/db/migrate/20100824062306_create_users.rb
333
+ - test/rails/overrides/spec/controllers/docomo_guid_spec.rb
334
+ - test/rails/overrides/spec/controllers/helpers_spec.rb
351
335
  - test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb
336
+ - test/rails/overrides/spec/controllers/template_path_spec.rb
352
337
  - test/rails/overrides/spec/controllers/trans_sid_controller_spec.rb
338
+ - test/rails/overrides/spec/features/admin/top_spec.rb
339
+ - test/rails/overrides/spec/features/filter_spec.rb
353
340
  - test/rails/overrides/spec/fixtures/mobile_mailer/au-attached.eml
354
341
  - test/rails/overrides/spec/fixtures/mobile_mailer/au-decomail.eml
355
342
  - test/rails/overrides/spec/fixtures/mobile_mailer/au-emoji.eml
@@ -372,12 +359,8 @@ files:
372
359
  - test/rails/overrides/spec/mailers/mobile_mailer_spec.rb
373
360
  - test/rails/overrides/spec/mailers/normal_mailer_spec.rb
374
361
  - test/rails/overrides/spec/rcov.opts
375
- - test/rails/overrides/spec/requests/admin/top_spec.rb
376
- - test/rails/overrides/spec/requests/docomo_guid_spec.rb
377
362
  - test/rails/overrides/spec/requests/docomo_spec.rb
378
363
  - test/rails/overrides/spec/requests/emobile_spec.rb
379
- - test/rails/overrides/spec/requests/filter_spec.rb
380
- - test/rails/overrides/spec/requests/helpers_spec.rb
381
364
  - test/rails/overrides/spec/requests/pc_spec.rb
382
365
  - test/rails/overrides/spec/requests/softbank_emulator_spec.rb
383
366
  - test/rails/overrides/spec/requests/template_path_spec.rb
@@ -405,17 +388,17 @@ require_paths:
405
388
  - lib
406
389
  required_ruby_version: !ruby/object:Gem::Requirement
407
390
  requirements:
408
- - - '>='
391
+ - - ">="
409
392
  - !ruby/object:Gem::Version
410
393
  version: '0'
411
394
  required_rubygems_version: !ruby/object:Gem::Requirement
412
395
  requirements:
413
- - - '>='
396
+ - - ">"
414
397
  - !ruby/object:Gem::Version
415
- version: '0'
398
+ version: 1.3.1
416
399
  requirements: []
417
400
  rubyforge_project:
418
- rubygems_version: 2.0.14
401
+ rubygems_version: 2.2.2
419
402
  signing_key:
420
403
  specification_version: 4
421
404
  summary: A Rails plugin for mobile devices in Japan
@@ -449,7 +432,6 @@ test_files:
449
432
  - spec/unit/email-fixtures/docomo-jis.eml
450
433
  - spec/unit/email-fixtures/iphone-mail3.eml
451
434
  - spec/unit/email-fixtures/iphone-message.eml
452
- - spec/unit/email-fixtures/pc-mail-attached-without-subject.eml
453
435
  - spec/unit/email-fixtures/pc-mail-multi.eml
454
436
  - spec/unit/email-fixtures/pc-mail-single.eml
455
437
  - spec/unit/email-fixtures/photo.jpg
@@ -555,8 +537,13 @@ test_files:
555
537
  - test/rails/overrides/config/routes.rb
556
538
  - test/rails/overrides/db/migrate/001_add_sessions_table.rb
557
539
  - test/rails/overrides/db/migrate/20100824062306_create_users.rb
540
+ - test/rails/overrides/spec/controllers/docomo_guid_spec.rb
541
+ - test/rails/overrides/spec/controllers/helpers_spec.rb
558
542
  - test/rails/overrides/spec/controllers/mobile_spec_controller_spec.rb
543
+ - test/rails/overrides/spec/controllers/template_path_spec.rb
559
544
  - test/rails/overrides/spec/controllers/trans_sid_controller_spec.rb
545
+ - test/rails/overrides/spec/features/admin/top_spec.rb
546
+ - test/rails/overrides/spec/features/filter_spec.rb
560
547
  - test/rails/overrides/spec/fixtures/mobile_mailer/au-attached.eml
561
548
  - test/rails/overrides/spec/fixtures/mobile_mailer/au-decomail.eml
562
549
  - test/rails/overrides/spec/fixtures/mobile_mailer/au-emoji.eml
@@ -579,12 +566,8 @@ test_files:
579
566
  - test/rails/overrides/spec/mailers/mobile_mailer_spec.rb
580
567
  - test/rails/overrides/spec/mailers/normal_mailer_spec.rb
581
568
  - test/rails/overrides/spec/rcov.opts
582
- - test/rails/overrides/spec/requests/admin/top_spec.rb
583
- - test/rails/overrides/spec/requests/docomo_guid_spec.rb
584
569
  - test/rails/overrides/spec/requests/docomo_spec.rb
585
570
  - test/rails/overrides/spec/requests/emobile_spec.rb
586
- - test/rails/overrides/spec/requests/filter_spec.rb
587
- - test/rails/overrides/spec/requests/helpers_spec.rb
588
571
  - test/rails/overrides/spec/requests/pc_spec.rb
589
572
  - test/rails/overrides/spec/requests/softbank_emulator_spec.rb
590
573
  - test/rails/overrides/spec/requests/template_path_spec.rb