File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9696
9797 describe ( "unfriendMe" , function ( ) {
9898
99+ afterEach ( function ( ) {
100+ return provider . removeInteractions ( )
101+ } )
102+
99103 describe ( "when I have some friends" , function ( ) {
100104
101105 beforeAll ( function ( done ) {
139143 state : 'I have no friends' ,
140144 uponReceiving : 'a request to unfriend' ,
141145 withRequest : {
142- method : 'put ' ,
146+ method : 'PUT ' ,
143147 path : '/unfriendMe'
144148 } ,
145149 willRespondWith : {
146- status : 404
150+ status : 404 ,
151+ body : { error : "No friends :(" }
147152 }
148153 } )
149154 . then ( function ( ) { done ( ) } , function ( err ) { done . fail ( err ) } )
154159 client . unfriendMe ( ) . then ( function ( ) {
155160 done ( new Error ( 'expected request to /unfriend me to fail' ) )
156161 } , function ( e ) {
162+ expect ( e . status ) . toEqual ( 404 )
163+ expect ( JSON . parse ( e . responseText ) . error ) . toEqual ( 'No friends :(' )
157164 done ( )
158165 } )
159166
Original file line number Diff line number Diff line change 9696
9797 describe ( "unfriendMe" , function ( ) {
9898
99+ afterEach ( function ( ) {
100+ return provider . removeInteractions ( )
101+ } )
102+
99103 describe ( "when I have some friends" , function ( ) {
100104
101105 before ( function ( done ) {
139143 state : 'I have no friends' ,
140144 uponReceiving : 'a request to unfriend' ,
141145 withRequest : {
142- method : 'put ' ,
146+ method : 'PUT ' ,
143147 path : '/unfriendMe'
144148 } ,
145149 willRespondWith : {
146- status : 404
150+ status : 404 ,
151+ body : { }
147152 }
148153 } )
149154 . then ( function ( ) { done ( ) } , function ( err ) { done ( err ) } )
154159 client . unfriendMe ( ) . then ( function ( ) {
155160 done ( new Error ( 'expected request to /unfriend me to fail' ) )
156161 } , function ( e ) {
162+ expect ( e ) . to . eql ( 'No friends :(' )
157163 done ( )
158164 } )
159165
You can’t perform that action at this time.
0 commit comments