@@ -84,16 +84,14 @@ describe('Instructor model ', function(){
8484 } ) ;
8585
8686 it ( 'does not save when firstName and lastName are empty ' , function ( ) {
87- model . set ( 'firstName' , null ) ;
88- model . set ( 'lastName' , null ) ;
87+ model . set ( { firstName :null , lastName :null } ) ;
8988 model . save ( ) ;
9089 expect ( model . validationError ) . toEqual ( [ 'firstName cannot be empty' ,
9190 'lastName cannot be empty' ] ) ;
9291 } ) ;
9392
9493 it ( 'does not save when firstName and skills are empty ' , function ( ) {
95- model . set ( 'firstName' , null ) ;
96- model . set ( 'skills' , null ) ;
94+ model . set ( { firstName :null , skills :null } ) ;
9795 model . save ( ) ;
9896 expect ( model . validationError ) . toEqual ( [ 'firstName cannot be empty' ,
9997 'skills cannot be empty' ] ) ;
@@ -106,8 +104,7 @@ describe('Instructor model ', function(){
106104 } ) ;
107105
108106 it ( 'does not save when lastName and skills are empty ' , function ( ) {
109- model . set ( 'lastName' , null ) ;
110- model . set ( 'skills' , null ) ;
107+ model . set ( { lastName :null , skills :null } ) ;
111108 model . save ( ) ;
112109 expect ( model . validationError ) . toEqual ( [ 'lastName cannot be empty' ,
113110 'skills cannot be empty' ] ) ;
@@ -120,9 +117,7 @@ describe('Instructor model ', function(){
120117 } ) ;
121118
122119 it ( 'does not save when all fields are empty ' , function ( ) {
123- model . set ( 'firstName' , null ) ;
124- model . set ( 'lastName' , null ) ;
125- model . set ( 'skills' , null ) ;
120+ model . set ( { firstName :null , lastName :null , skills :null } ) ;
126121 model . save ( ) ;
127122 expect ( model . validationError ) . toEqual ( [ 'firstName cannot be empty' ,
128123 'lastName cannot be empty' ,
0 commit comments