@@ -1413,6 +1413,18 @@ describe('state', function () {
1413
1413
expect ( $state . current . name ) . toBe ( "about" ) ;
1414
1414
} ) ) ;
1415
1415
1416
+ // test for https://github.com/ui-router/core/issues/74
1417
+ it ( 'should allow param objects containing $scope' , inject ( function ( $state , $q , $rootScope , $transitions ) {
1418
+ var errorhandler = jasmine . createSpy ( 'errorhandler' ) ;
1419
+ $state . defaultErrorHandler ( errorhandler ) ;
1420
+
1421
+ $state . go ( 'types' , { nonurl : { errorscope : $rootScope } } ) ;
1422
+ $q . flush ( ) ;
1423
+
1424
+ expect ( errorhandler ) . not . toHaveBeenCalled ( ) ;
1425
+ expect ( $state . params . nonurl && $state . params . nonurl . errorscope ) . toBe ( $rootScope ) ;
1426
+ } ) ) ;
1427
+
1416
1428
function expectStateUrlMappingFn ( $state , $rootScope , $q , $location ) {
1417
1429
return function ( state , url , params , defaults , nonurlparams ) {
1418
1430
$state . go ( state , extend ( { } , nonurlparams , params ) ) ;
@@ -1937,10 +1949,12 @@ describe('$stateParams', function () {
1937
1949
it ( 'should start empty' , inject ( function ( $stateParams ) {
1938
1950
expect ( $stateParams . foo ) . toBeUndefined ( ) ;
1939
1951
} ) ) ;
1952
+
1940
1953
it ( 'should allow setting values on it' , inject ( function ( $stateParams ) {
1941
1954
$stateParams . foo = 'bar' ;
1942
1955
expect ( $stateParams . foo ) . toBeDefined ( ) ;
1943
1956
} ) ) ;
1957
+
1944
1958
it ( 'should be cleared between tests' , inject ( function ( $stateParams ) {
1945
1959
expect ( $stateParams . foo ) . toBeUndefined ( ) ;
1946
1960
} ) ) ;
0 commit comments