crumbs 1.0.8 → 1.0.9
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.rdoc +1 -1
- data/lib/crumbs/action_controller/base.rb +40 -87
- data/lib/crumbs/definitions.rb +26 -0
- data/lib/crumbs/version.rb +1 -1
- data/lib/crumbs.rb +1 -2
- data/test/dummy/app/controllers/pages_controller.rb +1 -1
- data/test/dummy/log/test.log +13928 -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 +45 -45
- data/test/without_last_test.rb +40 -40
- metadata +20 -20
- data/lib/crumbs/history.rb +0 -34
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/test/with_last_test.rb
CHANGED
@@ -10,14 +10,14 @@ class WithLastTest < ActionDispatch::IntegrationTest
|
|
10
10
|
get '/'
|
11
11
|
assert_equal [
|
12
12
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/' }
|
13
|
-
], session[:
|
13
|
+
], session[:referers]
|
14
14
|
assert_select 'a', false
|
15
15
|
|
16
16
|
get '/static'
|
17
17
|
assert_equal [
|
18
18
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/' },
|
19
19
|
{ base_url: 'http://www.example.com', path: '/static', fullpath: '/static' }
|
20
|
-
], session[:
|
20
|
+
], session[:referers]
|
21
21
|
assert_select 'a', count: 2
|
22
22
|
assert_select 'a[href="/"]', 'Home'
|
23
23
|
assert_select 'a[href="/static"]', 'Static'
|
@@ -27,7 +27,7 @@ class WithLastTest < ActionDispatch::IntegrationTest
|
|
27
27
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/' },
|
28
28
|
{ base_url: 'http://www.example.com', path: '/static', fullpath: '/static' },
|
29
29
|
{ base_url: 'http://www.example.com', path: '/static/nested', fullpath: '/static/nested' }
|
30
|
-
], session[:
|
30
|
+
], session[:referers]
|
31
31
|
assert_select 'a', count: 3
|
32
32
|
assert_select 'a[href="/"]', 'Home'
|
33
33
|
assert_select 'a[href="/static"]', 'Static'
|
@@ -36,7 +36,7 @@ class WithLastTest < ActionDispatch::IntegrationTest
|
|
36
36
|
get '/'
|
37
37
|
assert_equal [
|
38
38
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/' }
|
39
|
-
], session[:
|
39
|
+
], session[:referers]
|
40
40
|
assert_select 'a', false
|
41
41
|
end
|
42
42
|
|
@@ -44,14 +44,14 @@ class WithLastTest < ActionDispatch::IntegrationTest
|
|
44
44
|
get '/?p1=p1'
|
45
45
|
assert_equal [
|
46
46
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' }
|
47
|
-
], session[:
|
47
|
+
], session[:referers]
|
48
48
|
assert_select 'a', false
|
49
49
|
|
50
50
|
get '/static?p2=p2'
|
51
51
|
assert_equal [
|
52
52
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
53
53
|
{ base_url: 'http://www.example.com', path: '/static', fullpath: '/static?p2=p2' }
|
54
|
-
], session[:
|
54
|
+
], session[:referers]
|
55
55
|
assert_select 'a', count: 2
|
56
56
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
57
57
|
assert_select 'a[href="/static?p2=p2"]', 'Static'
|
@@ -61,7 +61,7 @@ class WithLastTest < ActionDispatch::IntegrationTest
|
|
61
61
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
62
62
|
{ base_url: 'http://www.example.com', path: '/static', fullpath: '/static?p2=p2' },
|
63
63
|
{ base_url: 'http://www.example.com', path: '/static/nested', fullpath: '/static/nested?p3=p3' }
|
64
|
-
], session[:
|
64
|
+
], session[:referers]
|
65
65
|
assert_select 'a', count: 3
|
66
66
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
67
67
|
assert_select 'a[href="/static?p2=p2"]', 'Static'
|
@@ -70,22 +70,22 @@ class WithLastTest < ActionDispatch::IntegrationTest
|
|
70
70
|
get '/'
|
71
71
|
assert_equal [
|
72
72
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/' }
|
73
|
-
], session[:
|
73
|
+
], session[:referers]
|
74
74
|
assert_select 'a', false
|
75
75
|
end
|
76
76
|
|
77
|
-
test "gaps
|
77
|
+
test "gaps should not cause any error and should generate crumbs either" do
|
78
78
|
get '/?p1=p1'
|
79
79
|
assert_equal [
|
80
80
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' }
|
81
|
-
], session[:
|
81
|
+
], session[:referers]
|
82
82
|
assert_select 'a', false
|
83
83
|
|
84
84
|
get '/static/nested?p3=p3'
|
85
85
|
assert_equal [
|
86
86
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
87
87
|
{ base_url: 'http://www.example.com', path: '/static/nested', fullpath: '/static/nested?p3=p3' }
|
88
|
-
], session[:
|
88
|
+
], session[:referers]
|
89
89
|
assert_select 'a', count: 3
|
90
90
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
91
91
|
assert_select 'a[href="/static"]', 'Static'
|
@@ -94,22 +94,22 @@ class WithLastTest < ActionDispatch::IntegrationTest
|
|
94
94
|
get '/'
|
95
95
|
assert_equal [
|
96
96
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/' }
|
97
|
-
], session[:
|
97
|
+
], session[:referers]
|
98
98
|
assert_select 'a', false
|
99
99
|
end
|
100
100
|
|
101
|
-
test "empty crumbs
|
101
|
+
test "empty crumbs should not cause any error and should not generate crumbs" do
|
102
102
|
get '/?p1=p1'
|
103
103
|
assert_equal [
|
104
104
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' }
|
105
|
-
], session[:
|
105
|
+
], session[:referers]
|
106
106
|
assert_select 'a', false
|
107
107
|
|
108
108
|
get '/empty?p2=p2'
|
109
109
|
assert_equal [
|
110
110
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
111
111
|
{ base_url: 'http://www.example.com', path: '/empty', fullpath: '/empty?p2=p2' }
|
112
|
-
], session[:
|
112
|
+
], session[:referers]
|
113
113
|
assert_select 'a', count: 1
|
114
114
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
115
115
|
|
@@ -118,7 +118,7 @@ class WithLastTest < ActionDispatch::IntegrationTest
|
|
118
118
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
119
119
|
{ base_url: 'http://www.example.com', path: '/empty', fullpath: '/empty?p2=p2' },
|
120
120
|
{ base_url: 'http://www.example.com', path: '/empty/nested', fullpath: '/empty/nested?p3=p3' }
|
121
|
-
], session[:
|
121
|
+
], session[:referers]
|
122
122
|
assert_select 'a', count: 2
|
123
123
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
124
124
|
assert_select 'a[href="/empty/nested?p3=p3"]', 'Nested'
|
@@ -126,36 +126,36 @@ class WithLastTest < ActionDispatch::IntegrationTest
|
|
126
126
|
get '/'
|
127
127
|
assert_equal [
|
128
128
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/' }
|
129
|
-
], session[:
|
129
|
+
], session[:referers]
|
130
130
|
assert_select 'a', false
|
131
131
|
end
|
132
132
|
|
133
|
-
test "params
|
133
|
+
test "params should not cause any error and can be use alter crumb name" do
|
134
134
|
get '/?p1=p1'
|
135
135
|
assert_equal [
|
136
136
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' }
|
137
|
-
], session[:
|
137
|
+
], session[:referers]
|
138
138
|
assert_select 'a', false
|
139
139
|
|
140
140
|
get '/param?p2=p2'
|
141
141
|
assert_equal [
|
142
142
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
143
143
|
{ base_url: 'http://www.example.com', path: '/param', fullpath: '/param?p2=p2' }
|
144
|
-
], session[:
|
144
|
+
], session[:referers]
|
145
145
|
assert_select 'a', count: 2
|
146
146
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
147
|
-
assert_select 'a[href="/param?p2=p2"]', ''
|
147
|
+
assert_select 'a[href="/param?p2=p2"]', 'Param'
|
148
148
|
|
149
149
|
get '/param/1?p3=p3'
|
150
150
|
assert_equal [
|
151
151
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
152
152
|
{ base_url: 'http://www.example.com', path: '/param', fullpath: '/param?p2=p2' },
|
153
153
|
{ base_url: 'http://www.example.com', path: '/param/1', fullpath: '/param/1?p3=p3' }
|
154
|
-
], session[:
|
154
|
+
], session[:referers]
|
155
155
|
assert_select 'a', count: 3
|
156
156
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
157
|
-
assert_select 'a[href="/param?p2=p2"]', ''
|
158
|
-
assert_select 'a[href="/param/1?p3=p3"]', '
|
157
|
+
assert_select 'a[href="/param?p2=p2"]', 'Param'
|
158
|
+
assert_select 'a[href="/param/1?p3=p3"]', 'Param1'
|
159
159
|
|
160
160
|
get '/param/1/nested?p4=p4'
|
161
161
|
assert_equal [
|
@@ -163,46 +163,46 @@ class WithLastTest < ActionDispatch::IntegrationTest
|
|
163
163
|
{ base_url: 'http://www.example.com', path: '/param', fullpath: '/param?p2=p2' },
|
164
164
|
{ base_url: 'http://www.example.com', path: '/param/1', fullpath: '/param/1?p3=p3' },
|
165
165
|
{ base_url: 'http://www.example.com', path: '/param/1/nested', fullpath: '/param/1/nested?p4=p4' }
|
166
|
-
], session[:
|
166
|
+
], session[:referers]
|
167
167
|
assert_select 'a', count: 4
|
168
168
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
169
|
-
assert_select 'a[href="/param?p2=p2"]', ''
|
170
|
-
assert_select 'a[href="/param/1?p3=p3"]', '
|
169
|
+
assert_select 'a[href="/param?p2=p2"]', 'Param'
|
170
|
+
assert_select 'a[href="/param/1?p3=p3"]', 'Param1'
|
171
171
|
assert_select 'a[href="/param/1/nested?p4=p4"]', 'Nested'
|
172
172
|
|
173
173
|
get '/'
|
174
174
|
assert_equal [
|
175
175
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/' }
|
176
|
-
], session[:
|
176
|
+
], session[:referers]
|
177
177
|
assert_select 'a', false
|
178
178
|
end
|
179
179
|
|
180
|
-
test "going back
|
180
|
+
test "going back should not cause any error and should retain history" do
|
181
181
|
get '/?p1=p1'
|
182
182
|
assert_equal [
|
183
183
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' }
|
184
|
-
], session[:
|
184
|
+
], session[:referers]
|
185
185
|
assert_select 'a', false
|
186
186
|
|
187
187
|
get '/param?p2=p2'
|
188
188
|
assert_equal [
|
189
189
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
190
190
|
{ base_url: 'http://www.example.com', path: '/param', fullpath: '/param?p2=p2' }
|
191
|
-
], session[:
|
191
|
+
], session[:referers]
|
192
192
|
assert_select 'a', count: 2
|
193
193
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
194
|
-
assert_select 'a[href="/param?p2=p2"]', ''
|
194
|
+
assert_select 'a[href="/param?p2=p2"]', 'Param'
|
195
195
|
|
196
196
|
get '/param/1?p3=p3'
|
197
197
|
assert_equal [
|
198
198
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
199
199
|
{ base_url: 'http://www.example.com', path: '/param', fullpath: '/param?p2=p2' },
|
200
200
|
{ base_url: 'http://www.example.com', path: '/param/1', fullpath: '/param/1?p3=p3' }
|
201
|
-
], session[:
|
201
|
+
], session[:referers]
|
202
202
|
assert_select 'a', count: 3
|
203
203
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
204
|
-
assert_select 'a[href="/param?p2=p2"]', ''
|
205
|
-
assert_select 'a[href="/param/1?p3=p3"]', '
|
204
|
+
assert_select 'a[href="/param?p2=p2"]', 'Param'
|
205
|
+
assert_select 'a[href="/param/1?p3=p3"]', 'Param1'
|
206
206
|
|
207
207
|
get '/param/1/nested?p4=p4'
|
208
208
|
assert_equal [
|
@@ -210,35 +210,35 @@ class WithLastTest < ActionDispatch::IntegrationTest
|
|
210
210
|
{ base_url: 'http://www.example.com', path: '/param', fullpath: '/param?p2=p2' },
|
211
211
|
{ base_url: 'http://www.example.com', path: '/param/1', fullpath: '/param/1?p3=p3' },
|
212
212
|
{ base_url: 'http://www.example.com', path: '/param/1/nested', fullpath: '/param/1/nested?p4=p4' }
|
213
|
-
], session[:
|
213
|
+
], session[:referers]
|
214
214
|
assert_select 'a', count: 4
|
215
215
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
216
|
-
assert_select 'a[href="/param?p2=p2"]', ''
|
217
|
-
assert_select 'a[href="/param/1?p3=p3"]', '
|
216
|
+
assert_select 'a[href="/param?p2=p2"]', 'Param'
|
217
|
+
assert_select 'a[href="/param/1?p3=p3"]', 'Param1'
|
218
218
|
assert_select 'a[href="/param/1/nested?p4=p4"]', 'Nested'
|
219
219
|
|
220
220
|
get '/param'
|
221
221
|
assert_equal [
|
222
222
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
223
223
|
{ base_url: 'http://www.example.com', path: '/param', fullpath: '/param' }
|
224
|
-
], session[:
|
224
|
+
], session[:referers]
|
225
225
|
assert_select 'a', count: 2
|
226
226
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
227
|
-
assert_select 'a[href="/param"]', ''
|
227
|
+
assert_select 'a[href="/param"]', 'Param'
|
228
228
|
end
|
229
229
|
|
230
|
-
test "
|
230
|
+
test "translations should not cause any error" do
|
231
231
|
get '/?p1=p1'
|
232
232
|
assert_equal [
|
233
233
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' }
|
234
|
-
], session[:
|
234
|
+
], session[:referers]
|
235
235
|
assert_select 'a', false
|
236
236
|
|
237
237
|
get '/i18n?p2=p2'
|
238
238
|
assert_equal [
|
239
239
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
240
240
|
{ base_url: 'http://www.example.com', path: '/i18n', fullpath: '/i18n?p2=p2' }
|
241
|
-
], session[:
|
241
|
+
], session[:referers]
|
242
242
|
assert_select 'a', count: 2
|
243
243
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
244
244
|
assert_select 'a[href="/i18n?p2=p2"]', 'Hello world'
|
@@ -248,7 +248,7 @@ class WithLastTest < ActionDispatch::IntegrationTest
|
|
248
248
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
249
249
|
{ base_url: 'http://www.example.com', path: '/i18n', fullpath: '/i18n?p2=p2' },
|
250
250
|
{ base_url: 'http://www.example.com', path: '/i18n/nested', fullpath: '/i18n/nested?p3=p3' }
|
251
|
-
], session[:
|
251
|
+
], session[:referers]
|
252
252
|
assert_select 'a', count: 3
|
253
253
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
254
254
|
assert_select 'a[href="/i18n?p2=p2"]', 'Hello world'
|
@@ -257,7 +257,7 @@ class WithLastTest < ActionDispatch::IntegrationTest
|
|
257
257
|
get '/?p1=p1'
|
258
258
|
assert_equal [
|
259
259
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' }
|
260
|
-
], session[:
|
260
|
+
], session[:referers]
|
261
261
|
assert_select 'a', false
|
262
262
|
end
|
263
263
|
|
data/test/without_last_test.rb
CHANGED
@@ -10,14 +10,14 @@ class WithoutLastTest < ActionDispatch::IntegrationTest
|
|
10
10
|
get '/'
|
11
11
|
assert_equal [
|
12
12
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/' }
|
13
|
-
], session[:
|
13
|
+
], session[:referers]
|
14
14
|
assert_select 'a', false
|
15
15
|
|
16
16
|
get '/static'
|
17
17
|
assert_equal [
|
18
18
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/' },
|
19
19
|
{ base_url: 'http://www.example.com', path: '/static', fullpath: '/static' }
|
20
|
-
], session[:
|
20
|
+
], session[:referers]
|
21
21
|
assert_select 'a', count: 1
|
22
22
|
assert_select 'a[href="/"]', 'Home'
|
23
23
|
|
@@ -26,7 +26,7 @@ class WithoutLastTest < ActionDispatch::IntegrationTest
|
|
26
26
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/' },
|
27
27
|
{ base_url: 'http://www.example.com', path: '/static', fullpath: '/static' },
|
28
28
|
{ base_url: 'http://www.example.com', path: '/static/nested', fullpath: '/static/nested' }
|
29
|
-
], session[:
|
29
|
+
], session[:referers]
|
30
30
|
assert_select 'a', count: 2
|
31
31
|
assert_select 'a[href="/"]', 'Home'
|
32
32
|
assert_select 'a[href="/static"]', 'Static'
|
@@ -34,7 +34,7 @@ class WithoutLastTest < ActionDispatch::IntegrationTest
|
|
34
34
|
get '/'
|
35
35
|
assert_equal [
|
36
36
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/' }
|
37
|
-
], session[:
|
37
|
+
], session[:referers]
|
38
38
|
assert_select 'a', false
|
39
39
|
end
|
40
40
|
|
@@ -42,14 +42,14 @@ class WithoutLastTest < ActionDispatch::IntegrationTest
|
|
42
42
|
get '/?p1=p1'
|
43
43
|
assert_equal [
|
44
44
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' }
|
45
|
-
], session[:
|
45
|
+
], session[:referers]
|
46
46
|
assert_select 'a', false
|
47
47
|
|
48
48
|
get '/static?p2=p2'
|
49
49
|
assert_equal [
|
50
50
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
51
51
|
{ base_url: 'http://www.example.com', path: '/static', fullpath: '/static?p2=p2' }
|
52
|
-
], session[:
|
52
|
+
], session[:referers]
|
53
53
|
assert_select 'a', count: 1
|
54
54
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
55
55
|
|
@@ -58,7 +58,7 @@ class WithoutLastTest < ActionDispatch::IntegrationTest
|
|
58
58
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
59
59
|
{ base_url: 'http://www.example.com', path: '/static', fullpath: '/static?p2=p2' },
|
60
60
|
{ base_url: 'http://www.example.com', path: '/static/nested', fullpath: '/static/nested?p3=p3' }
|
61
|
-
], session[:
|
61
|
+
], session[:referers]
|
62
62
|
assert_select 'a', count: 2
|
63
63
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
64
64
|
assert_select 'a[href="/static?p2=p2"]', 'Static'
|
@@ -66,22 +66,22 @@ class WithoutLastTest < ActionDispatch::IntegrationTest
|
|
66
66
|
get '/'
|
67
67
|
assert_equal [
|
68
68
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/' }
|
69
|
-
], session[:
|
69
|
+
], session[:referers]
|
70
70
|
assert_select 'a', false
|
71
71
|
end
|
72
72
|
|
73
|
-
test "gaps
|
73
|
+
test "gaps should not cause any error and should generate crumbs either" do
|
74
74
|
get '/?p1=p1'
|
75
75
|
assert_equal [
|
76
76
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' }
|
77
|
-
], session[:
|
77
|
+
], session[:referers]
|
78
78
|
assert_select 'a', false
|
79
79
|
|
80
80
|
get '/static/nested?p3=p3'
|
81
81
|
assert_equal [
|
82
82
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
83
83
|
{ base_url: 'http://www.example.com', path: '/static/nested', fullpath: '/static/nested?p3=p3' }
|
84
|
-
], session[:
|
84
|
+
], session[:referers]
|
85
85
|
assert_select 'a', count: 2
|
86
86
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
87
87
|
assert_select 'a[href="/static"]', 'Static'
|
@@ -89,22 +89,22 @@ class WithoutLastTest < ActionDispatch::IntegrationTest
|
|
89
89
|
get '/'
|
90
90
|
assert_equal [
|
91
91
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/' }
|
92
|
-
], session[:
|
92
|
+
], session[:referers]
|
93
93
|
assert_select 'a', false
|
94
94
|
end
|
95
95
|
|
96
|
-
test "empty crumbs
|
96
|
+
test "empty crumbs should not cause any error and should not generate crumbs" do
|
97
97
|
get '/?p1=p1'
|
98
98
|
assert_equal [
|
99
99
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' }
|
100
|
-
], session[:
|
100
|
+
], session[:referers]
|
101
101
|
assert_select 'a', false
|
102
102
|
|
103
103
|
get '/empty?p2=p2'
|
104
104
|
assert_equal [
|
105
105
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
106
106
|
{ base_url: 'http://www.example.com', path: '/empty', fullpath: '/empty?p2=p2' }
|
107
|
-
], session[:
|
107
|
+
], session[:referers]
|
108
108
|
assert_select 'a', count: 1
|
109
109
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
110
110
|
|
@@ -113,29 +113,29 @@ class WithoutLastTest < ActionDispatch::IntegrationTest
|
|
113
113
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
114
114
|
{ base_url: 'http://www.example.com', path: '/empty', fullpath: '/empty?p2=p2' },
|
115
115
|
{ base_url: 'http://www.example.com', path: '/empty/nested', fullpath: '/empty/nested?p3=p3' }
|
116
|
-
], session[:
|
116
|
+
], session[:referers]
|
117
117
|
assert_select 'a', count: 1
|
118
118
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
119
119
|
|
120
120
|
get '/'
|
121
121
|
assert_equal [
|
122
122
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/' }
|
123
|
-
], session[:
|
123
|
+
], session[:referers]
|
124
124
|
assert_select 'a', false
|
125
125
|
end
|
126
126
|
|
127
|
-
test "params
|
127
|
+
test "params should not cause any error and can be use alter crumb name" do
|
128
128
|
get '/?p1=p1'
|
129
129
|
assert_equal [
|
130
130
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' }
|
131
|
-
], session[:
|
131
|
+
], session[:referers]
|
132
132
|
assert_select 'a', false
|
133
133
|
|
134
134
|
get '/param?p2=p2'
|
135
135
|
assert_equal [
|
136
136
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
137
137
|
{ base_url: 'http://www.example.com', path: '/param', fullpath: '/param?p2=p2' }
|
138
|
-
], session[:
|
138
|
+
], session[:referers]
|
139
139
|
assert_select 'a', count: 1
|
140
140
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
141
141
|
|
@@ -144,10 +144,10 @@ class WithoutLastTest < ActionDispatch::IntegrationTest
|
|
144
144
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
145
145
|
{ base_url: 'http://www.example.com', path: '/param', fullpath: '/param?p2=p2' },
|
146
146
|
{ base_url: 'http://www.example.com', path: '/param/1', fullpath: '/param/1?p3=p3' }
|
147
|
-
], session[:
|
147
|
+
], session[:referers]
|
148
148
|
assert_select 'a', count: 2
|
149
149
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
150
|
-
assert_select 'a[href="/param?p2=p2"]', ''
|
150
|
+
assert_select 'a[href="/param?p2=p2"]', 'Param'
|
151
151
|
|
152
152
|
get '/param/1/nested?p4=p4'
|
153
153
|
assert_equal [
|
@@ -155,31 +155,31 @@ class WithoutLastTest < ActionDispatch::IntegrationTest
|
|
155
155
|
{ base_url: 'http://www.example.com', path: '/param', fullpath: '/param?p2=p2' },
|
156
156
|
{ base_url: 'http://www.example.com', path: '/param/1', fullpath: '/param/1?p3=p3' },
|
157
157
|
{ base_url: 'http://www.example.com', path: '/param/1/nested', fullpath: '/param/1/nested?p4=p4' }
|
158
|
-
], session[:
|
158
|
+
], session[:referers]
|
159
159
|
assert_select 'a', count: 3
|
160
160
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
161
|
-
assert_select 'a[href="/param?p2=p2"]', ''
|
162
|
-
assert_select 'a[href="/param/1?p3=p3"]', '
|
161
|
+
assert_select 'a[href="/param?p2=p2"]', 'Param'
|
162
|
+
assert_select 'a[href="/param/1?p3=p3"]', 'Param1'
|
163
163
|
|
164
164
|
get '/'
|
165
165
|
assert_equal [
|
166
166
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/' }
|
167
|
-
], session[:
|
167
|
+
], session[:referers]
|
168
168
|
assert_select 'a', false
|
169
169
|
end
|
170
170
|
|
171
|
-
test "going back
|
171
|
+
test "going back should not cause any error and should retain history" do
|
172
172
|
get '/?p1=p1'
|
173
173
|
assert_equal [
|
174
174
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' }
|
175
|
-
], session[:
|
175
|
+
], session[:referers]
|
176
176
|
assert_select 'a', false
|
177
177
|
|
178
178
|
get '/param?p2=p2'
|
179
179
|
assert_equal [
|
180
180
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
181
181
|
{ base_url: 'http://www.example.com', path: '/param', fullpath: '/param?p2=p2' }
|
182
|
-
], session[:
|
182
|
+
], session[:referers]
|
183
183
|
assert_select 'a', count: 1
|
184
184
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
185
185
|
|
@@ -188,10 +188,10 @@ class WithoutLastTest < ActionDispatch::IntegrationTest
|
|
188
188
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
189
189
|
{ base_url: 'http://www.example.com', path: '/param', fullpath: '/param?p2=p2' },
|
190
190
|
{ base_url: 'http://www.example.com', path: '/param/1', fullpath: '/param/1?p3=p3' }
|
191
|
-
], session[:
|
191
|
+
], session[:referers]
|
192
192
|
assert_select 'a', count: 2
|
193
193
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
194
|
-
assert_select 'a[href="/param?p2=p2"]', ''
|
194
|
+
assert_select 'a[href="/param?p2=p2"]', 'Param'
|
195
195
|
|
196
196
|
get '/param/1/nested?p4=p4'
|
197
197
|
assert_equal [
|
@@ -199,33 +199,33 @@ class WithoutLastTest < ActionDispatch::IntegrationTest
|
|
199
199
|
{ base_url: 'http://www.example.com', path: '/param', fullpath: '/param?p2=p2' },
|
200
200
|
{ base_url: 'http://www.example.com', path: '/param/1', fullpath: '/param/1?p3=p3' },
|
201
201
|
{ base_url: 'http://www.example.com', path: '/param/1/nested', fullpath: '/param/1/nested?p4=p4' }
|
202
|
-
], session[:
|
202
|
+
], session[:referers]
|
203
203
|
assert_select 'a', count: 3
|
204
204
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
205
|
-
assert_select 'a[href="/param?p2=p2"]', ''
|
206
|
-
assert_select 'a[href="/param/1?p3=p3"]', '
|
205
|
+
assert_select 'a[href="/param?p2=p2"]', 'Param'
|
206
|
+
assert_select 'a[href="/param/1?p3=p3"]', 'Param1'
|
207
207
|
|
208
208
|
get '/param'
|
209
209
|
assert_equal [
|
210
210
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
211
211
|
{ base_url: 'http://www.example.com', path: '/param', fullpath: '/param' }
|
212
|
-
], session[:
|
212
|
+
], session[:referers]
|
213
213
|
assert_select 'a', count: 1
|
214
214
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
215
215
|
end
|
216
216
|
|
217
|
-
test "
|
217
|
+
test "translations should not cause any error" do
|
218
218
|
get '/?p1=p1'
|
219
219
|
assert_equal [
|
220
220
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' }
|
221
|
-
], session[:
|
221
|
+
], session[:referers]
|
222
222
|
assert_select 'a', false
|
223
223
|
|
224
224
|
get '/i18n?p2=p2'
|
225
225
|
assert_equal [
|
226
226
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
227
227
|
{ base_url: 'http://www.example.com', path: '/i18n', fullpath: '/i18n?p2=p2' }
|
228
|
-
], session[:
|
228
|
+
], session[:referers]
|
229
229
|
assert_select 'a', count: 1
|
230
230
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
231
231
|
|
@@ -234,7 +234,7 @@ class WithoutLastTest < ActionDispatch::IntegrationTest
|
|
234
234
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' },
|
235
235
|
{ base_url: 'http://www.example.com', path: '/i18n', fullpath: '/i18n?p2=p2' },
|
236
236
|
{ base_url: 'http://www.example.com', path: '/i18n/nested', fullpath: '/i18n/nested?p3=p3' }
|
237
|
-
], session[:
|
237
|
+
], session[:referers]
|
238
238
|
assert_select 'a', count: 2
|
239
239
|
assert_select 'a[href="/?p1=p1"]', 'Home'
|
240
240
|
assert_select 'a[href="/i18n?p2=p2"]', 'Hello world'
|
@@ -242,7 +242,7 @@ class WithoutLastTest < ActionDispatch::IntegrationTest
|
|
242
242
|
get '/?p1=p1'
|
243
243
|
assert_equal [
|
244
244
|
{ base_url: 'http://www.example.com', path: '/', fullpath: '/?p1=p1' }
|
245
|
-
], session[:
|
245
|
+
], session[:referers]
|
246
246
|
assert_select 'a', false
|
247
247
|
end
|
248
248
|
|