@@ -312,9 +312,6 @@ def valid?; false; end;
312312 end 
313313
314314 should  "not update an invalid model"  do 
315-  subject . expects ( :persisted? ) . returns ( true ) 
316-  subject . expects ( :id ) . returns ( 'abc123' ) . at_least_once 
317- 318315 @gateway 
319316 . expects ( :update ) 
320317 . never 
@@ -323,19 +320,19 @@ def valid?; false; end;
323320 def  valid? ;  false ;  end ; 
324321 end 
325322
326-  assert  ! subject . update 
327-  assert  ! subject . persisted? 
323+  assert  ! subject . update ( title : 'INVALID' ) 
328324 end 
329325
330326 should  "skip the validation with the :validate option"  do 
331-  subject . expects ( :persisted? ) . returns ( true ) 
327+  subject . expects ( :persisted? ) . returns ( true ) . at_least_once 
332328 subject . expects ( :id ) . returns ( 'abc123' ) . at_least_once 
333329
334330 @gateway 
335331 . expects ( :update ) 
336332 . with  do  |object ,  options |
337-  assert_equal  subject ,  object 
333+  assert_equal  'abc123' ,  object 
338334 assert_equal  nil ,  options [ :id ] 
335+  assert_equal  'INVALID' ,  options [ :doc ] [ :title ] 
339336 true 
340337 end 
341338 . returns ( { '_id'  =>  'abc123' } ) 
@@ -344,7 +341,7 @@ def valid?; false; end;
344341 def  valid? ;  false ;  end ; 
345342 end 
346343
347-  assert  subject . update validate : false 
344+  assert  subject . update ( { title :  'INVALID' } , { validate : false } ) 
348345 assert  subject . persisted? 
349346 end 
350347
0 commit comments