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', () => {
584
584
585
585
describe ( 'PATCH /:resource/:id' , ( ) => {
586
586
it ( 'should respond with json and update resource' , ( done ) => {
587
+ var partial = { body : 'bar' }
588
+ var post = { id : 1 , body : 'bar' }
587
589
request ( server )
588
590
. patch ( '/posts/1' )
589
- . send ( { body : 'bar' } )
591
+ . send ( partial )
590
592
. expect ( 'Content-Type' , / j s o n / )
591
- . expect ( { id : 1 , body : 'bar' } )
593
+ . expect ( post )
592
594
. expect ( 200 )
593
595
. end ( ( err , res ) => {
594
596
if ( err ) return done ( err )
595
597
assert . deepStrictEqual ( res . body , post )
596
598
// assert it was created in database too
597
- assert . deepStrictEqual ( db . posts [ 0 ] , { id : 1 , body : 'bar' } )
599
+ assert . deepStrictEqual ( db . posts [ 0 ] , post )
598
600
done ( )
599
601
} )
600
602
} )
You can’t perform that action at this time.
0 commit comments