Skip to content

Commit 27a7b36

Browse files
nateabelechristopherthielen
authored andcommitted
cherry-pick 9dc31c5 from 0.2.17
1 parent a428b2f commit 27a7b36

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/stateDirectivesSpec.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ describe('uiStateRef', function() {
1515
url: '/contacts',
1616
template: '<a ui-sref=".item({ id: 5 })" class="item">Person</a> <ui-view></ui-view>'
1717
}).state('contacts.item', {
18-
url: '/:id',
19-
params: { id: null },
18+
url: '/{id:int}',
2019
template: '<a ui-sref=".detail" class="item-detail">Detail</a> | <a ui-sref="^" class="item-parent">Parent</a> | <ui-view></ui-view>'
2120
}).state('contacts.item.detail', {
2221
template: '<div class="title">Detail</div> | <a ui-sref="^" class="item-parent2">Item</a>'
@@ -134,7 +133,7 @@ describe('uiStateRef', function() {
134133
$q.flush();
135134

136135
expect($state.current.name).toEqual('contacts.item.detail');
137-
expect(obj($stateParams)).toEqualData({ id: "5" });
136+
expect(obj($stateParams)).toEqualData({ id: 5 });
138137
}));
139138

140139
it('should transition when given a click that contains no data (fake-click)', inject(function($state, $stateParams, $q) {
@@ -151,7 +150,7 @@ describe('uiStateRef', function() {
151150
$q.flush();
152151

153152
expect($state.current.name).toEqual('contacts.item.detail');
154-
expect(obj($stateParams)).toEqualData({ id: "5" });
153+
expect(obj($stateParams)).toEqualData({ id: 5 });
155154
}));
156155

157156
it('should not transition states when ctrl-clicked', inject(function($state, $stateParams, $q) {
@@ -404,7 +403,7 @@ describe('uiStateRef', function() {
404403
$q.flush();
405404

406405
expect($state.$current.name).toBe("contacts.item.detail");
407-
expect(obj($state.params)).toEqualData({ id: "5" });
406+
expect(obj($state.params)).toEqualData({ id: 5 });
408407
}));
409408

410409
it('should resolve states from parent uiView', inject(function ($state, $stateParams, $q, $timeout) {

0 commit comments

Comments
 (0)