@@ -252,6 +252,7 @@ describe('state', function () {
252
252
} ,
253
253
OPT = { url : '/opt/:param' , params : { param : "100" } , template : "opt" } ,
254
254
OPT2 = { url : '/opt2/:param2/:param3' , params : { param3 : "300" , param4 : "400" } , template : "opt2" } ,
255
+ ISS2101 = { params : { bar : { squash : false , value : 'qux' } } , url : '/2101/{bar:string}' } ,
255
256
URLLESS = { url : '/urllessparams' , params : { myparam : { type : 'int' } } } ,
256
257
AppInjectable = { } ;
257
258
@@ -277,6 +278,7 @@ describe('state', function () {
277
278
. state ( 'dynamicstate' , dynamicstate )
278
279
. state ( 'OPT' , OPT )
279
280
. state ( 'OPT.OPT2' , OPT2 )
281
+ . state ( 'ISS2101' , ISS2101 )
280
282
. state ( 'URLLESS' , URLLESS )
281
283
. state ( 'home' , { url : "/" } )
282
284
. state ( 'home.item' , { url : "front/:id" } )
@@ -1081,6 +1083,10 @@ describe('state', function () {
1081
1083
expect ( $state . href ( "home" ) ) . toEqual ( "#!/" ) ;
1082
1084
} ) ) ;
1083
1085
1086
+ it ( 'generates urls with unsquashable default params' , inject ( function ( $state ) {
1087
+ expect ( $state . href ( "ISS2101" ) ) . toEqual ( "#/2101/qux" ) ;
1088
+ } ) ) ;
1089
+
1084
1090
describe ( 'when $browser.baseHref() exists' , function ( ) {
1085
1091
beforeEach ( inject ( function ( $browser ) {
1086
1092
spyOn ( services . locationConfig , 'baseHref' ) . and . callFake ( function ( ) {
@@ -1114,7 +1120,7 @@ describe('state', function () {
1114
1120
1115
1121
it ( "should return all of the state's config" , inject ( function ( $state ) {
1116
1122
var list = $state . get ( ) . sort ( function ( a , b ) { return ( a . name > b . name ) - ( b . name > a . name ) ; } ) ;
1117
- var names = [ '' , 'A' , 'B' , 'C' , 'D' , 'DD' , 'E' , 'F' , 'H' , 'HH' , 'HHH' , 'OPT' , 'OPT.OPT2' , 'RS' , 'URLLESS' ,
1123
+ var names = [ '' , 'A' , 'B' , 'C' , 'D' , 'DD' , 'E' , 'F' , 'H' , 'HH' , 'HHH' , 'ISS2101' , ' OPT', 'OPT.OPT2' , 'RS' , 'URLLESS' ,
1118
1124
'about' , 'about.person' , 'about.person.item' , 'about.sidebar' , 'about.sidebar.item' ,
1119
1125
'badParam' , 'badParam2' , 'dynamicTemplate' , 'dynamicstate' , 'first' , 'home' , 'home.item' , 'home.redirect' ,
1120
1126
'json' , 'logA' , 'logA.logB' , 'logA.logB.logC' , 'resolveFail' , 'resolveTimeout' ,
0 commit comments