crumbs 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +1 -1
- data/lib/crumbs/action_controller/base.rb +5 -3
- data/lib/crumbs/definitions.rb +5 -1
- data/lib/crumbs/version.rb +1 -1
- data/test/dummy/config/environments/production.rb +5 -1
- data/test/dummy/config/environments/test.rb +9 -1
- data/test/dummy/log/development.log +83 -0
- data/test/dummy/log/test.log +2320 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/with_last_test.rb +458 -201
- data/test/without_last_test.rb +402 -173
- metadata +7 -7
data/test/without_last_test.rb
CHANGED
@@ -8,242 +8,471 @@ class WithoutLastTest < ActionDispatch::IntegrationTest
|
|
8
8
|
|
9
9
|
test 'last request in same path' do
|
10
10
|
get '/'
|
11
|
-
assert_equal
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
assert_equal(
|
12
|
+
[
|
13
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/' }
|
14
|
+
],
|
15
|
+
session[:referers]
|
16
|
+
)
|
17
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
18
|
+
assert_select 'a', 0
|
19
|
+
else
|
20
|
+
assert_select 'a', false
|
21
|
+
end
|
22
|
+
|
16
23
|
get '/static'
|
17
|
-
assert_equal
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
24
|
+
assert_equal(
|
25
|
+
[
|
26
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/' },
|
27
|
+
{ base_url: 'http://www.example.com', path: '/static', fullpath: '/static' }
|
28
|
+
],
|
29
|
+
session[:referers]
|
30
|
+
)
|
31
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
32
|
+
assert_select 'a', 1
|
33
|
+
assert_select 'a[href="/"]:contains("Home")'
|
34
|
+
else
|
35
|
+
assert_select 'a', count: 1
|
36
|
+
assert_select 'a[href="/"]', 'Home'
|
37
|
+
end
|
23
38
|
|
24
39
|
get '/static/nested'
|
25
|
-
assert_equal
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
40
|
+
assert_equal(
|
41
|
+
[
|
42
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/' },
|
43
|
+
{ base_url: 'http://www.example.com', path: '/static', fullpath: '/static' },
|
44
|
+
{ base_url: 'http://www.example.com', path: '/static/nested', fullpath: '/static/nested' }
|
45
|
+
],
|
46
|
+
session[:referers]
|
47
|
+
)
|
48
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
49
|
+
assert_select 'a', 2
|
50
|
+
assert_select 'a[href="/"]:contains("Home")'
|
51
|
+
assert_select 'a[href="/static"]:contains("Static")'
|
52
|
+
else
|
53
|
+
assert_select 'a', count: 2
|
54
|
+
assert_select 'a[href="/"]', 'Home'
|
55
|
+
assert_select 'a[href="/static"]', 'Static'
|
56
|
+
end
|
33
57
|
|
34
58
|
get '/'
|
35
|
-
assert_equal
|
36
|
-
|
37
|
-
|
38
|
-
|
59
|
+
assert_equal(
|
60
|
+
[
|
61
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/' }
|
62
|
+
],
|
63
|
+
session[:referers]
|
64
|
+
)
|
65
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
66
|
+
assert_select 'a', 0
|
67
|
+
else
|
68
|
+
assert_select 'a', false
|
69
|
+
end
|
39
70
|
end
|
40
71
|
|
41
72
|
test 'remember last request with parameters in the same path' do
|
42
73
|
get '/?p1=p1'
|
43
|
-
assert_equal
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
74
|
+
assert_equal(
|
75
|
+
[
|
76
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' }
|
77
|
+
],
|
78
|
+
session[:referers]
|
79
|
+
)
|
80
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
81
|
+
assert_select 'a', 0
|
82
|
+
else
|
83
|
+
assert_select 'a', false
|
84
|
+
end
|
85
|
+
|
48
86
|
get '/static?p2=p2'
|
49
|
-
assert_equal
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
87
|
+
assert_equal(
|
88
|
+
[
|
89
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
90
|
+
{ base_url: 'http://www.example.com', path: '/static', fullpath: '/static?p2=p2' }
|
91
|
+
],
|
92
|
+
session[:referers]
|
93
|
+
)
|
94
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
95
|
+
assert_select 'a', 1
|
96
|
+
assert_select 'a[href="/?p1=p1"]:contains("Home")'
|
97
|
+
else
|
98
|
+
assert_select 'a', count: 1
|
99
|
+
assert_select 'a[href="/?p1=p1"]', 'Home'
|
100
|
+
end
|
55
101
|
|
56
102
|
get '/static/nested?p3=p3'
|
57
|
-
assert_equal
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
103
|
+
assert_equal(
|
104
|
+
[
|
105
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
106
|
+
{ base_url: 'http://www.example.com', path: '/static', fullpath: '/static?p2=p2' },
|
107
|
+
{ base_url: 'http://www.example.com', path: '/static/nested', fullpath: '/static/nested?p3=p3' }
|
108
|
+
],
|
109
|
+
session[:referers]
|
110
|
+
)
|
111
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
112
|
+
assert_select 'a', 2
|
113
|
+
assert_select 'a[href="/?p1=p1"]:contains("Home")'
|
114
|
+
assert_select 'a[href="/static?p2=p2"]:contains("Static")'
|
115
|
+
else
|
116
|
+
assert_select 'a', count: 2
|
117
|
+
assert_select 'a[href="/?p1=p1"]', 'Home'
|
118
|
+
assert_select 'a[href="/static?p2=p2"]', 'Static'
|
119
|
+
end
|
65
120
|
|
66
121
|
get '/'
|
67
|
-
assert_equal
|
68
|
-
|
69
|
-
|
70
|
-
|
122
|
+
assert_equal(
|
123
|
+
[
|
124
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/' }
|
125
|
+
],
|
126
|
+
session[:referers]
|
127
|
+
)
|
128
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
129
|
+
assert_select 'a', 0
|
130
|
+
else
|
131
|
+
assert_select 'a', false
|
132
|
+
end
|
71
133
|
end
|
72
134
|
|
73
135
|
test 'gaps not cause any error and generate crumbs either' do
|
74
136
|
get '/?p1=p1'
|
75
|
-
assert_equal
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
137
|
+
assert_equal(
|
138
|
+
[
|
139
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' }
|
140
|
+
],
|
141
|
+
session[:referers]
|
142
|
+
)
|
143
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
144
|
+
assert_select 'a', 0
|
145
|
+
else
|
146
|
+
assert_select 'a', false
|
147
|
+
end
|
148
|
+
|
80
149
|
get '/static/nested?p3=p3'
|
81
|
-
assert_equal
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
150
|
+
assert_equal(
|
151
|
+
[
|
152
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
153
|
+
{ base_url: 'http://www.example.com', path: '/static/nested', fullpath: '/static/nested?p3=p3' }
|
154
|
+
],
|
155
|
+
session[:referers]
|
156
|
+
)
|
157
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
158
|
+
assert_select 'a', 2
|
159
|
+
assert_select 'a[href="/?p1=p1"]:contains("Home")'
|
160
|
+
assert_select 'a[href="/static"]:contains("Static")'
|
161
|
+
else
|
162
|
+
assert_select 'a', count: 2
|
163
|
+
assert_select 'a[href="/?p1=p1"]', 'Home'
|
164
|
+
assert_select 'a[href="/static"]', 'Static'
|
165
|
+
end
|
88
166
|
|
89
167
|
get '/'
|
90
|
-
assert_equal
|
91
|
-
|
92
|
-
|
93
|
-
|
168
|
+
assert_equal(
|
169
|
+
[
|
170
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/' }
|
171
|
+
],
|
172
|
+
session[:referers]
|
173
|
+
)
|
174
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
175
|
+
assert_select 'a', 0
|
176
|
+
else
|
177
|
+
assert_select 'a', false
|
178
|
+
end
|
94
179
|
end
|
95
180
|
|
96
181
|
test 'empty crumbs not cause any error and not generate crumbs' do
|
97
182
|
get '/?p1=p1'
|
98
|
-
assert_equal
|
99
|
-
|
100
|
-
|
101
|
-
|
183
|
+
assert_equal(
|
184
|
+
[
|
185
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' }
|
186
|
+
],
|
187
|
+
session[:referers]
|
188
|
+
)
|
189
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
190
|
+
assert_select 'a', 0
|
191
|
+
else
|
192
|
+
assert_select 'a', false
|
193
|
+
end
|
102
194
|
|
103
195
|
get '/empty?p2=p2'
|
104
|
-
assert_equal
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
196
|
+
assert_equal(
|
197
|
+
[
|
198
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
199
|
+
{ base_url: 'http://www.example.com', path: '/empty', fullpath: '/empty?p2=p2' }
|
200
|
+
],
|
201
|
+
session[:referers]
|
202
|
+
)
|
203
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
204
|
+
assert_select 'a', 1
|
205
|
+
assert_select 'a[href="/?p1=p1"]:contains("Home")'
|
206
|
+
else
|
207
|
+
assert_select 'a', count: 1
|
208
|
+
assert_select 'a[href="/?p1=p1"]', 'Home'
|
209
|
+
end
|
110
210
|
|
111
211
|
get '/empty/nested?p3=p3'
|
112
|
-
assert_equal
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
212
|
+
assert_equal(
|
213
|
+
[
|
214
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
215
|
+
{ base_url: 'http://www.example.com', path: '/empty', fullpath: '/empty?p2=p2' },
|
216
|
+
{ base_url: 'http://www.example.com', path: '/empty/nested', fullpath: '/empty/nested?p3=p3' }
|
217
|
+
],
|
218
|
+
session[:referers]
|
219
|
+
)
|
220
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
221
|
+
assert_select 'a', 1
|
222
|
+
assert_select 'a[href="/?p1=p1"]:contains("Home")'
|
223
|
+
else
|
224
|
+
assert_select 'a', count: 1
|
225
|
+
assert_select 'a[href="/?p1=p1"]', 'Home'
|
226
|
+
end
|
119
227
|
|
120
228
|
get '/'
|
121
|
-
assert_equal
|
122
|
-
|
123
|
-
|
124
|
-
|
229
|
+
assert_equal(
|
230
|
+
[
|
231
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/' }
|
232
|
+
],
|
233
|
+
session[:referers]
|
234
|
+
)
|
235
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
236
|
+
assert_select 'a', 0
|
237
|
+
else
|
238
|
+
assert_select 'a', false
|
239
|
+
end
|
125
240
|
end
|
126
241
|
|
127
242
|
test 'params not cause any error and can be use alter crumb name' do
|
128
243
|
get '/?p1=p1'
|
129
|
-
assert_equal
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
244
|
+
assert_equal(
|
245
|
+
[
|
246
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' }
|
247
|
+
],
|
248
|
+
session[:referers]
|
249
|
+
)
|
250
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
251
|
+
assert_select 'a', 0
|
252
|
+
else
|
253
|
+
assert_select 'a', false
|
254
|
+
end
|
255
|
+
|
134
256
|
get '/param?p2=p2'
|
135
|
-
assert_equal
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
257
|
+
assert_equal(
|
258
|
+
[
|
259
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
260
|
+
{ base_url: 'http://www.example.com', path: '/param', fullpath: '/param?p2=p2' }
|
261
|
+
],
|
262
|
+
session[:referers]
|
263
|
+
)
|
264
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
265
|
+
assert_select 'a', 1
|
266
|
+
assert_select 'a[href="/?p1=p1"]:contains("Home")'
|
267
|
+
else
|
268
|
+
assert_select 'a', count: 1
|
269
|
+
assert_select 'a[href="/?p1=p1"]', 'Home'
|
270
|
+
end
|
141
271
|
|
142
272
|
get '/param/1?p3=p3'
|
143
|
-
assert_equal
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
273
|
+
assert_equal(
|
274
|
+
[
|
275
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
276
|
+
{ base_url: 'http://www.example.com', path: '/param', fullpath: '/param?p2=p2' },
|
277
|
+
{ base_url: 'http://www.example.com', path: '/param/1', fullpath: '/param/1?p3=p3' }
|
278
|
+
],
|
279
|
+
session[:referers]
|
280
|
+
)
|
281
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
282
|
+
assert_select 'a', 2
|
283
|
+
assert_select 'a[href="/?p1=p1"]:contains("Home")'
|
284
|
+
assert_select 'a[href="/param?p2=p2"]:contains("Param")'
|
285
|
+
else
|
286
|
+
assert_select 'a', count: 2
|
287
|
+
assert_select 'a[href="/?p1=p1"]', 'Home'
|
288
|
+
assert_select 'a[href="/param?p2=p2"]', 'Param'
|
289
|
+
end
|
151
290
|
|
152
291
|
get '/param/1/nested?p4=p4'
|
153
|
-
assert_equal
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
292
|
+
assert_equal(
|
293
|
+
[
|
294
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
295
|
+
{ base_url: 'http://www.example.com', path: '/param', fullpath: '/param?p2=p2' },
|
296
|
+
{ base_url: 'http://www.example.com', path: '/param/1', fullpath: '/param/1?p3=p3' },
|
297
|
+
{ base_url: 'http://www.example.com', path: '/param/1/nested', fullpath: '/param/1/nested?p4=p4' }
|
298
|
+
],
|
299
|
+
session[:referers]
|
300
|
+
)
|
301
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
302
|
+
assert_select 'a', 3
|
303
|
+
assert_select 'a[href="/?p1=p1"]:contains("Home")'
|
304
|
+
assert_select 'a[href="/param?p2=p2"]:contains("Param")'
|
305
|
+
assert_select 'a[href="/param/1?p3=p3"]:contains("Param1")'
|
306
|
+
else
|
307
|
+
assert_select 'a', count: 3
|
308
|
+
assert_select 'a[href="/?p1=p1"]', 'Home'
|
309
|
+
assert_select 'a[href="/param?p2=p2"]', 'Param'
|
310
|
+
assert_select 'a[href="/param/1?p3=p3"]', 'Param1'
|
311
|
+
end
|
163
312
|
|
164
313
|
get '/'
|
165
|
-
assert_equal
|
166
|
-
|
167
|
-
|
168
|
-
|
314
|
+
assert_equal(
|
315
|
+
[
|
316
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/' }
|
317
|
+
],
|
318
|
+
session[:referers]
|
319
|
+
)
|
320
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
321
|
+
assert_select 'a', 0
|
322
|
+
else
|
323
|
+
assert_select 'a', false
|
324
|
+
end
|
169
325
|
end
|
170
326
|
|
171
327
|
test 'going back not cause any error and retain history' do
|
172
328
|
get '/?p1=p1'
|
173
|
-
assert_equal
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
329
|
+
assert_equal(
|
330
|
+
[
|
331
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' }
|
332
|
+
],
|
333
|
+
session[:referers]
|
334
|
+
)
|
335
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
336
|
+
assert_select 'a', 0
|
337
|
+
else
|
338
|
+
assert_select 'a', false
|
339
|
+
end
|
340
|
+
|
178
341
|
get '/param?p2=p2'
|
179
|
-
assert_equal
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
342
|
+
assert_equal(
|
343
|
+
[
|
344
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
345
|
+
{ base_url: 'http://www.example.com', path: '/param', fullpath: '/param?p2=p2' }
|
346
|
+
],
|
347
|
+
session[:referers]
|
348
|
+
)
|
349
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
350
|
+
assert_select 'a', 1
|
351
|
+
assert_select 'a[href="/?p1=p1"]:contains("Home")'
|
352
|
+
else
|
353
|
+
assert_select 'a', count: 1
|
354
|
+
assert_select 'a[href="/?p1=p1"]', 'Home'
|
355
|
+
end
|
185
356
|
|
186
357
|
get '/param/1?p3=p3'
|
187
|
-
assert_equal
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
358
|
+
assert_equal(
|
359
|
+
[
|
360
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
361
|
+
{ base_url: 'http://www.example.com', path: '/param', fullpath: '/param?p2=p2' },
|
362
|
+
{ base_url: 'http://www.example.com', path: '/param/1', fullpath: '/param/1?p3=p3' }
|
363
|
+
],
|
364
|
+
session[:referers]
|
365
|
+
)
|
366
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
367
|
+
assert_select 'a', 2
|
368
|
+
assert_select 'a[href="/?p1=p1"]:contains("Home")'
|
369
|
+
assert_select 'a[href="/param?p2=p2"]:contains("Param")'
|
370
|
+
else
|
371
|
+
assert_select 'a', count: 2
|
372
|
+
assert_select 'a[href="/?p1=p1"]', 'Home'
|
373
|
+
assert_select 'a[href="/param?p2=p2"]', 'Param'
|
374
|
+
end
|
195
375
|
|
196
376
|
get '/param/1/nested?p4=p4'
|
197
|
-
assert_equal
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
377
|
+
assert_equal(
|
378
|
+
[
|
379
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
380
|
+
{ base_url: 'http://www.example.com', path: '/param', fullpath: '/param?p2=p2' },
|
381
|
+
{ base_url: 'http://www.example.com', path: '/param/1', fullpath: '/param/1?p3=p3' },
|
382
|
+
{ base_url: 'http://www.example.com', path: '/param/1/nested', fullpath: '/param/1/nested?p4=p4' }
|
383
|
+
],
|
384
|
+
session[:referers]
|
385
|
+
)
|
386
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
387
|
+
assert_select 'a', 3
|
388
|
+
assert_select 'a[href="/?p1=p1"]:contains("Home")'
|
389
|
+
assert_select 'a[href="/param?p2=p2"]:contains("Param")'
|
390
|
+
assert_select 'a[href="/param/1?p3=p3"]:contains("Param1")'
|
391
|
+
else
|
392
|
+
assert_select 'a', count: 3
|
393
|
+
assert_select 'a[href="/?p1=p1"]', 'Home'
|
394
|
+
assert_select 'a[href="/param?p2=p2"]', 'Param'
|
395
|
+
assert_select 'a[href="/param/1?p3=p3"]', 'Param1'
|
396
|
+
end
|
207
397
|
|
208
398
|
get '/param'
|
209
|
-
assert_equal
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
399
|
+
assert_equal(
|
400
|
+
[
|
401
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
402
|
+
{ base_url: 'http://www.example.com', path: '/param', fullpath: '/param' }
|
403
|
+
],
|
404
|
+
session[:referers]
|
405
|
+
)
|
406
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
407
|
+
assert_select 'a', 1
|
408
|
+
assert_select 'a[href="/?p1=p1"]:contains("Home")'
|
409
|
+
else
|
410
|
+
assert_select 'a', count: 1
|
411
|
+
assert_select 'a[href="/?p1=p1"]', 'Home'
|
412
|
+
end
|
215
413
|
end
|
216
414
|
|
217
415
|
test 'translations not cause any error' do
|
218
416
|
get '/?p1=p1'
|
219
|
-
assert_equal
|
220
|
-
|
221
|
-
|
222
|
-
|
417
|
+
assert_equal(
|
418
|
+
[
|
419
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' }
|
420
|
+
],
|
421
|
+
session[:referers]
|
422
|
+
)
|
423
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
424
|
+
assert_select 'a', 0
|
425
|
+
else
|
426
|
+
assert_select 'a', false
|
427
|
+
end
|
223
428
|
|
224
429
|
get '/i18n?p2=p2'
|
225
|
-
assert_equal
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
430
|
+
assert_equal(
|
431
|
+
[
|
432
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
433
|
+
{ base_url: 'http://www.example.com', path: '/i18n', fullpath: '/i18n?p2=p2' }
|
434
|
+
],
|
435
|
+
session[:referers]
|
436
|
+
)
|
437
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
438
|
+
assert_select 'a', 1
|
439
|
+
assert_select 'a[href="/?p1=p1"]:contains("Home")'
|
440
|
+
else
|
441
|
+
assert_select 'a', count: 1
|
442
|
+
assert_select 'a[href="/?p1=p1"]', 'Home'
|
443
|
+
end
|
231
444
|
|
232
445
|
get '/i18n/nested?p3=p3'
|
233
|
-
assert_equal
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
446
|
+
assert_equal(
|
447
|
+
[
|
448
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
449
|
+
{ base_url: 'http://www.example.com', path: '/i18n', fullpath: '/i18n?p2=p2' },
|
450
|
+
{ base_url: 'http://www.example.com', path: '/i18n/nested', fullpath: '/i18n/nested?p3=p3' }
|
451
|
+
],
|
452
|
+
session[:referers]
|
453
|
+
)
|
454
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
455
|
+
assert_select 'a', 2
|
456
|
+
assert_select 'a[href="/?p1=p1"]:contains("Home")'
|
457
|
+
assert_select 'a[href="/i18n?p2=p2"]:contains("Hello world")'
|
458
|
+
else
|
459
|
+
assert_select 'a', count: 2
|
460
|
+
assert_select 'a[href="/?p1=p1"]', 'Home'
|
461
|
+
assert_select 'a[href="/i18n?p2=p2"]', 'Hello world'
|
462
|
+
end
|
241
463
|
|
242
464
|
get '/?p1=p1'
|
243
|
-
assert_equal
|
244
|
-
|
245
|
-
|
246
|
-
|
465
|
+
assert_equal(
|
466
|
+
[
|
467
|
+
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' }
|
468
|
+
],
|
469
|
+
session[:referers]
|
470
|
+
)
|
471
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
472
|
+
assert_select 'a', 0
|
473
|
+
else
|
474
|
+
assert_select 'a', false
|
475
|
+
end
|
247
476
|
end
|
248
477
|
|
249
478
|
end
|