@@ -107,14 +107,14 @@ describe('tabs', function() {
107107 beforeEach ( inject ( function ( $compile , $rootScope ) {
108108 scope = $rootScope . $new ( ) ;
109109
110- function makeTab ( ) {
110+ function makeTab ( active ) {
111111 return {
112- active : false ,
112+ active : ! ! active ,
113113 select : jasmine . createSpy ( )
114114 } ;
115115 }
116116 scope . tabs = [
117- makeTab ( ) , makeTab ( ) , makeTab ( ) , makeTab ( )
117+ makeTab ( ) , makeTab ( ) , makeTab ( true ) , makeTab ( )
118118 ] ;
119119 elm = $compile ( [
120120 '<tabset>' ,
@@ -140,7 +140,7 @@ describe('tabs', function() {
140140 if ( activeTab === tab ) {
141141 expect ( tab . active ) . toBe ( true ) ;
142142 //It should only call select ONCE for each select
143- expect ( tab . select . callCount ) . toBe ( 1 ) ;
143+ expect ( tab . select ) . toHaveBeenCalled ( ) ;
144144 expect ( _titles . eq ( i ) ) . toHaveClass ( 'active' ) ;
145145 expect ( contents ( ) . eq ( i ) . text ( ) . trim ( ) ) . toBe ( 'content ' + i ) ;
146146 expect ( contents ( ) . eq ( i ) ) . toHaveClass ( 'active' ) ;
@@ -151,9 +151,9 @@ describe('tabs', function() {
151151 } ) ;
152152 }
153153
154- it ( 'should make tab titles with first content and first active' , function ( ) {
154+ it ( 'should make tab titles and set active tab active' , function ( ) {
155155 expect ( titles ( ) . length ) . toBe ( scope . tabs . length ) ;
156- expectTabActive ( scope . tabs [ 0 ] ) ;
156+ expectTabActive ( scope . tabs [ 2 ] ) ;
157157 } ) ;
158158
159159 it ( 'should switch active when clicking' , function ( ) {
0 commit comments