@@ -322,10 +322,6 @@ if ($.support.pjax) {
322
322
data : { foo : 1 , bar : 2 } ,
323
323
container : "#main"
324
324
} )
325
-
326
- // URL is set immediately
327
- equal ( frame . location . pathname , "/env.html" )
328
- equal ( frame . location . search , "?foo=1&bar=2" )
329
325
} )
330
326
331
327
asyncTest ( "GET data is merged into query string" , function ( ) {
@@ -345,10 +341,6 @@ if ($.support.pjax) {
345
341
data : { bar : 2 } ,
346
342
container : "#main"
347
343
} )
348
-
349
- // URL is set immediately
350
- equal ( frame . location . pathname , "/env.html" )
351
- equal ( frame . location . search , "?foo=1&bar=2" )
352
344
} )
353
345
354
346
asyncTest ( "mixed containers" , function ( ) {
@@ -745,9 +737,6 @@ if ($.support.pjax) {
745
737
container : "#main"
746
738
} )
747
739
748
- equal ( frame . location . pathname , "/timeout.html" )
749
- equal ( frame . location . hash , "#hello" )
750
-
751
740
this . iframe . onload = function ( ) {
752
741
equal ( frame . $ ( "#main p" ) . html ( ) , "SLOW DOWN!" )
753
742
equal ( frame . location . pathname , "/timeout.html" )
@@ -817,7 +806,7 @@ if ($.support.pjax) {
817
806
var frame = this . frame
818
807
819
808
frame . $ ( "#main" ) . on ( "pjax:complete" , function ( ) {
820
- equal ( frame . location . pathname , "/boom .html" )
809
+ equal ( frame . location . pathname , "/home .html" )
821
810
start ( )
822
811
} )
823
812
frame . $ ( "#main" ) . on ( "pjax:error" , function ( event , xhr ) {
@@ -835,6 +824,26 @@ if ($.support.pjax) {
835
824
} )
836
825
} )
837
826
827
+ asyncTest ( "address bar only updates on success" , function ( ) {
828
+ var frame = this . frame
829
+
830
+ equal ( frame . location . pathname , "/home.html" )
831
+
832
+ frame . $ ( "#main" ) . on ( 'pjax:send' , function ( ) {
833
+ equal ( frame . location . pathname , "/home.html" )
834
+ } )
835
+
836
+ frame . $ ( "#main" ) . on ( 'pjax:end' , function ( ) {
837
+ equal ( frame . location . pathname , "/hello.html" )
838
+ start ( )
839
+ } )
840
+
841
+ frame . $ . pjax ( {
842
+ url : "hello.html" ,
843
+ container : "#main"
844
+ } )
845
+ } )
846
+
838
847
function goBack ( frame , callback ) {
839
848
setTimeout ( function ( ) {
840
849
frame . $ ( "#main" ) . one ( "pjax:end" , callback )
0 commit comments