@@ -148,7 +148,7 @@ $(document).ready(function() {
148148 equals ( model . get ( 'two' ) , null ) ;
149149 } ) ;
150150
151- test ( "Model: changed , hasChanged, changedAttributes, previous, previousAttributes" , function ( ) {
151+ test ( "Model: change , hasChanged, changedAttributes, previous, previousAttributes" , function ( ) {
152152 var model = new Backbone . Model ( { name : "Tim" , age : 10 } ) ;
153153 model . bind ( 'change' , function ( ) {
154154 ok ( model . hasChanged ( 'name' ) , 'name changed' ) ;
@@ -162,6 +162,19 @@ $(document).ready(function() {
162162 equals ( model . get ( 'name' ) , 'Rob' ) ;
163163 } ) ;
164164
165+ test ( "Model: change with options" , function ( ) {
166+ var value ;
167+ var model = new Backbone . Model ( { name : 'Rob' } ) ;
168+ model . bind ( 'change' , function ( model , options ) {
169+ value = options . prefix + model . get ( 'name' ) ;
170+ } ) ;
171+ model . set ( { name : 'Bob' } , { silent : true } ) ;
172+ model . change ( { prefix : 'Mr. ' } ) ;
173+ equals ( value , 'Mr. Bob' ) ;
174+ model . set ( { name : 'Sue' } , { prefix : 'Ms. ' } ) ;
175+ equals ( value , 'Ms. Sue' ) ;
176+ } ) ;
177+
165178 test ( "Model: save within change event" , function ( ) {
166179 var model = new Backbone . Model ( { firstName : "Taylor" , lastName : "Swift" } ) ;
167180 model . bind ( 'change' , function ( ) {
0 commit comments