@@ -864,6 +864,88 @@ describe('$location', function() {
864
864
} ) ;
865
865
866
866
867
+ it ( 'should not rewrite when link to different base path when history enabled on new browser' ,
868
+ function ( ) {
869
+ configureService ( '/other_base/link' , true , true ) ;
870
+ inject (
871
+ initBrowser ( ) ,
872
+ initLocation ( ) ,
873
+ function ( $browser ) {
874
+ browserTrigger ( link , 'click' ) ;
875
+ expectNoRewrite ( $browser ) ;
876
+ }
877
+ ) ;
878
+ } ) ;
879
+
880
+
881
+ it ( 'should not rewrite when link to different base path when history enabled on old browser' ,
882
+ function ( ) {
883
+ configureService ( '/other_base/link' , true , false ) ;
884
+ inject (
885
+ initBrowser ( ) ,
886
+ initLocation ( ) ,
887
+ function ( $browser ) {
888
+ browserTrigger ( link , 'click' ) ;
889
+ expectNoRewrite ( $browser ) ;
890
+ }
891
+ ) ;
892
+ } ) ;
893
+
894
+
895
+ it ( 'should not rewrite when link to different base path when history disabled' , function ( ) {
896
+ configureService ( '/other_base/link' , false ) ;
897
+ inject (
898
+ initBrowser ( ) ,
899
+ initLocation ( ) ,
900
+ function ( $browser ) {
901
+ browserTrigger ( link , 'click' ) ;
902
+ expectNoRewrite ( $browser ) ;
903
+ }
904
+ ) ;
905
+ } ) ;
906
+
907
+
908
+ it ( 'should not rewrite when full link to different base path when history enabled on new browser' ,
909
+ function ( ) {
910
+ configureService ( 'http://host.com/other_base/link' , true , true ) ;
911
+ inject (
912
+ initBrowser ( ) ,
913
+ initLocation ( ) ,
914
+ function ( $browser ) {
915
+ browserTrigger ( link , 'click' ) ;
916
+ expectNoRewrite ( $browser ) ;
917
+ }
918
+ ) ;
919
+ } ) ;
920
+
921
+
922
+ it ( 'should not rewrite when full link to different base path when history enabled on old browser' ,
923
+ function ( ) {
924
+ configureService ( 'http://host.com/other_base/link' , true , false ) ;
925
+ inject (
926
+ initBrowser ( ) ,
927
+ initLocation ( ) ,
928
+ function ( $browser ) {
929
+ browserTrigger ( link , 'click' ) ;
930
+ expectNoRewrite ( $browser ) ;
931
+ }
932
+ ) ;
933
+ } ) ;
934
+
935
+
936
+ it ( 'should not rewrite when full link to different base path when history disabled' , function ( ) {
937
+ configureService ( 'http://host.com/other_base/link' , false ) ;
938
+ inject (
939
+ initBrowser ( ) ,
940
+ initLocation ( ) ,
941
+ function ( $browser ) {
942
+ browserTrigger ( link , 'click' ) ;
943
+ expectNoRewrite ( $browser ) ;
944
+ }
945
+ ) ;
946
+ } ) ;
947
+
948
+
867
949
// don't run next tests on IE<9, as browserTrigger does not simulate pressed keys
868
950
if ( ! ( msie < 9 ) ) {
869
951
0 commit comments