@@ -322,10 +322,6 @@ if ($.support.pjax) {
322322 data : { foo : 1 , bar : 2 } ,
323323 container : "#main"
324324 } )
325-
326- // URL is set immediately
327- equal ( frame . location . pathname , "/env.html" )
328- equal ( frame . location . search , "?foo=1&bar=2" )
329325 } )
330326
331327 asyncTest ( "GET data is merged into query string" , function ( ) {
@@ -345,10 +341,6 @@ if ($.support.pjax) {
345341 data : { bar : 2 } ,
346342 container : "#main"
347343 } )
348-
349- // URL is set immediately
350- equal ( frame . location . pathname , "/env.html" )
351- equal ( frame . location . search , "?foo=1&bar=2" )
352344 } )
353345
354346 asyncTest ( "mixed containers" , function ( ) {
@@ -745,9 +737,6 @@ if ($.support.pjax) {
745737 container : "#main"
746738 } )
747739
748- equal ( frame . location . pathname , "/timeout.html" )
749- equal ( frame . location . hash , "#hello" )
750-
751740 this . iframe . onload = function ( ) {
752741 equal ( frame . $ ( "#main p" ) . html ( ) , "SLOW DOWN!" )
753742 equal ( frame . location . pathname , "/timeout.html" )
@@ -817,7 +806,7 @@ if ($.support.pjax) {
817806 var frame = this . frame
818807
819808 frame . $ ( "#main" ) . on ( "pjax:complete" , function ( ) {
820- equal ( frame . location . pathname , "/boom .html" )
809+ equal ( frame . location . pathname , "/home .html" )
821810 start ( )
822811 } )
823812 frame . $ ( "#main" ) . on ( "pjax:error" , function ( event , xhr ) {
@@ -835,6 +824,26 @@ if ($.support.pjax) {
835824 } )
836825 } )
837826
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+
838847 function goBack ( frame , callback ) {
839848 setTimeout ( function ( ) {
840849 frame . $ ( "#main" ) . one ( "pjax:end" , callback )
0 commit comments