Skip to content

Commit eb2a919

Browse files
cherry pick 17e7757
1 parent 53454c6 commit eb2a919

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/stateSpec.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ describe('state', function () {
252252
},
253253
OPT = { url: '/opt/:param', params: { param: "100" }, template: "opt" },
254254
OPT2 = { url: '/opt2/:param2/:param3', params: { param3: "300", param4: "400" }, template: "opt2" },
255+
ISS2101 = { params: { bar: { squash: false, value: 'qux'}}, url: '/2101/{bar:string}'},
255256
URLLESS = { url: '/urllessparams', params: { myparam: { type: 'int' } } },
256257
AppInjectable = {};
257258

@@ -277,6 +278,7 @@ describe('state', function () {
277278
.state('dynamicstate', dynamicstate)
278279
.state('OPT', OPT)
279280
.state('OPT.OPT2', OPT2)
281+
.state('ISS2101', ISS2101)
280282
.state('URLLESS', URLLESS)
281283
.state('home', { url: "/" })
282284
.state('home.item', { url: "front/:id" })
@@ -1081,6 +1083,10 @@ describe('state', function () {
10811083
expect($state.href("home")).toEqual("#!/");
10821084
}));
10831085

1086+
it('generates urls with unsquashable default params', inject(function($state) {
1087+
expect($state.href("ISS2101")).toEqual("#/2101/qux");
1088+
}));
1089+
10841090
describe('when $browser.baseHref() exists', function() {
10851091
beforeEach(inject(function($browser) {
10861092
spyOn(services.locationConfig, 'baseHref').and.callFake(function() {
@@ -1114,7 +1120,7 @@ describe('state', function () {
11141120

11151121
it("should return all of the state's config", inject(function ($state) {
11161122
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',
11181124
'about', 'about.person', 'about.person.item', 'about.sidebar', 'about.sidebar.item',
11191125
'badParam', 'badParam2', 'dynamicTemplate', 'dynamicstate', 'first', 'home', 'home.item', 'home.redirect',
11201126
'json', 'logA', 'logA.logB', 'logA.logB.logC', 'resolveFail', 'resolveTimeout',

0 commit comments

Comments
 (0)