File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -584,17 +584,19 @@ describe('Server', () => {
584584
585585 describe ( 'PATCH /:resource/:id' , ( ) => {
586586 it ( 'should respond with json and update resource' , ( done ) => {
587+ var partial = { body : 'bar' }
588+ var post = { id : 1 , body : 'bar' }
587589 request ( server )
588590 . patch ( '/posts/1' )
589- . send ( { body : 'bar' } )
591+ . send ( partial )
590592 . expect ( 'Content-Type' , / j s o n / )
591- . expect ( { id : 1 , body : 'bar' } )
593+ . expect ( post )
592594 . expect ( 200 )
593595 . end ( ( err , res ) => {
594596 if ( err ) return done ( err )
595597 assert . deepStrictEqual ( res . body , post )
596598 // assert it was created in database too
597- assert . deepStrictEqual ( db . posts [ 0 ] , { id : 1 , body : 'bar' } )
599+ assert . deepStrictEqual ( db . posts [ 0 ] , post )
598600 done ( )
599601 } )
600602 } )
You can’t perform that action at this time.
0 commit comments