File tree Expand file tree Collapse file tree 1 file changed +38
-1
lines changed Expand file tree Collapse file tree 1 file changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -215,7 +215,7 @@ if ($.support.pjax) {
215
215
} )
216
216
} )
217
217
218
- asyncTest ( "sets hidden _pjax param on XHR GET request" , function ( ) {
218
+ asyncTest ( "sets hidden _pjax param on XHR GET request" , 1 , function ( ) {
219
219
var frame = this . frame
220
220
221
221
frame . $ ( '#main' ) . on ( 'pjax:success' , function ( ) {
@@ -225,6 +225,43 @@ if ($.support.pjax) {
225
225
} )
226
226
frame . $ . pjax ( {
227
227
url : "env.html" ,
228
+ data : undefined ,
229
+ container : "#main"
230
+ } )
231
+ } )
232
+
233
+ asyncTest ( "sets hidden _pjax param if array data is supplied" , 1 , function ( ) {
234
+ var frame = this . frame
235
+
236
+ frame . $ ( '#main' ) . on ( 'pjax:success' , function ( ) {
237
+ var env = JSON . parse ( frame . $ ( "#env" ) . text ( ) )
238
+ deepEqual ( env [ 'rack.request.query_hash' ] , {
239
+ _pjax : '#main' ,
240
+ foo : 'bar'
241
+ } )
242
+ start ( )
243
+ } )
244
+ frame . $ . pjax ( {
245
+ url : "env.html" ,
246
+ data : [ { name : "foo" , value : "bar" } ] ,
247
+ container : "#main"
248
+ } )
249
+ } )
250
+
251
+ asyncTest ( "sets hidden _pjax param if object data is supplied" , 1 , function ( ) {
252
+ var frame = this . frame
253
+
254
+ frame . $ ( '#main' ) . on ( 'pjax:success' , function ( ) {
255
+ var env = JSON . parse ( frame . $ ( "#env" ) . text ( ) )
256
+ deepEqual ( env [ 'rack.request.query_hash' ] , {
257
+ _pjax : '#main' ,
258
+ foo : 'bar'
259
+ } )
260
+ start ( )
261
+ } )
262
+ frame . $ . pjax ( {
263
+ url : "env.html" ,
264
+ data : { foo : "bar" } ,
228
265
container : "#main"
229
266
} )
230
267
} )
You can’t perform that action at this time.
0 commit comments