11describe ( 'angular-confirm' , function ( ) {
22
3- var $rootScope , $modal ;
3+ var $rootScope , $uibModal ;
44
55 beforeEach ( angular . mock . module ( 'angular-confirm' , function ( $provide ) {
66
7- $provide . decorator ( '$modal ' , function ( $delegate ) {
8- $modal = {
9- open : jasmine . createSpy ( '$modal .open' , function ( settings ) {
7+ $provide . decorator ( '$uibModal ' , function ( $delegate ) {
8+ $uibModal = {
9+ open : jasmine . createSpy ( '$uibModal .open' , function ( settings ) {
1010 return { result : settings } ;
1111 } )
1212 } ;
13- return $modal ;
13+ return $uibModal ;
1414 } ) ;
1515
1616 $provide . decorator ( '$confirm' , function ( $delegate ) {
@@ -24,18 +24,18 @@ describe('angular-confirm', function() {
2424 } ) ) ;
2525
2626 describe ( 'ConfirmModalController' , function ( ) {
27- var $scope , controller , data = { testVal : 1 } , $modalInstance ;
27+ var $scope , controller , data = { testVal : 1 } , $uibModalInstance ;
2828
2929 beforeEach ( angular . mock . inject ( function ( $controller ) {
3030 $scope = $rootScope . $new ( ) ;
31- $modalInstance = {
32- close : jasmine . createSpy ( 'modalInstance .close' ) ,
33- dismiss : jasmine . createSpy ( 'modalInstance .dismiss' ) ,
31+ $uibModalInstance = {
32+ close : jasmine . createSpy ( '$uibModalInstance .close' ) ,
33+ dismiss : jasmine . createSpy ( '$uibModalInstance .dismiss' ) ,
3434 result : {
35- then : jasmine . createSpy ( 'modalInstance .result.then' )
35+ then : jasmine . createSpy ( '$uibModalInstance .result.then' )
3636 }
3737 } ;
38- controller = $controller ( 'ConfirmModalController' , { "$scope" : $scope , "$modalInstance " : $modalInstance , "data" : data } ) ;
38+ controller = $controller ( 'ConfirmModalController' , { "$scope" : $scope , "$uibModalInstance " : $uibModalInstance , "data" : data } ) ;
3939 } ) ) ;
4040
4141 it ( "should copy the data, not use it as a reference" , function ( ) {
@@ -45,12 +45,12 @@ describe('angular-confirm', function() {
4545
4646 it ( "should call close when $scope.ok is invoked" , function ( ) {
4747 $scope . ok ( ) ;
48- expect ( $modalInstance . close ) . toHaveBeenCalled ( ) ;
48+ expect ( $uibModalInstance . close ) . toHaveBeenCalled ( ) ;
4949 } ) ;
5050
5151 it ( "should call dismiss when $scope.cancel is invoked" , function ( ) {
5252 $scope . cancel ( ) ;
53- expect ( $modalInstance . dismiss ) . toHaveBeenCalledWith ( 'cancel' ) ;
53+ expect ( $uibModalInstance . dismiss ) . toHaveBeenCalledWith ( 'cancel' ) ;
5454 } ) ;
5555
5656 } ) ;
@@ -63,12 +63,12 @@ describe('angular-confirm', function() {
6363 $confirm = _$confirm_ ;
6464 $confirm . and . callThrough ( ) ;
6565 $confirmModalDefaults = _$confirmModalDefaults_ ;
66- $modal . open . and . callThrough ( ) ;
66+ $uibModal . open . and . callThrough ( ) ;
6767 } ) ) ;
6868
69- it ( "should call $modal .open" , function ( ) {
69+ it ( "should call $uibModal .open" , function ( ) {
7070 $confirm ( ) ;
71- expect ( $modal . open ) . toHaveBeenCalled ( ) ;
71+ expect ( $uibModal . open ) . toHaveBeenCalled ( ) ;
7272 } ) ;
7373
7474 it ( "should override the defaults with settings passed in" , function ( ) {
0 commit comments