@@ -542,11 +542,12 @@ if ($.support.pjax) {
542542
543543 frame . $ ( "#main" )
544544 . text ( beforeContent )
545- . on ( "pjax:beforeReplace" , function ( event , contents , options ) {
545+ . on ( "pjax:beforeReplace" , function ( event , contents , options , previousState ) {
546546 ok ( event )
547547 ok ( contents )
548548 equal ( $ ( event . target ) . text ( ) , beforeContent )
549549 equal ( options . url , "hello.html" )
550+ ok ( previousState . url . match ( "/home.html" ) )
550551 ok ( frame . $ . pjax . state . url . match ( "/hello.html" ) )
551552 } )
552553 frame . $ ( "#main" ) . on ( "pjax:success" , function ( event ) {
@@ -861,13 +862,15 @@ if ($.support.pjax) {
861862 equal ( frame . location . pathname , "/hello.html" )
862863 ok ( frame . history . length > 1 )
863864
864- frame . $ ( '#main' ) . on ( 'pjax:beforeReplace' , function ( event , contents , options ) {
865+ frame . $ ( '#main' ) . on ( 'pjax:beforeReplace' , function ( event , contents , options , previousState ) {
865866 ok ( event )
866867 ok ( contents )
867868 equal ( frame . location . pathname , "/home.html" )
869+ ok ( options . url . match ( "/home.html" ) )
870+ ok ( previousState . url . match ( "/hello.html" ) )
871+ ok ( frame . $ . pjax . state . url . match ( "/home.html" ) )
868872 // Remember: the content hasn't yet been replaced.
869873 notEqual ( $ ( event . target ) . html ( ) , originalContent )
870- ok ( frame . $ . pjax . state . url . match ( "/home.html" ) )
871874 start ( )
872875 } )
873876
0 commit comments