const podsUtils = {
getFriendsList,
makeFriends,
- quitFriends
+ quitFriends,
+ quitOneFriend
}
// ---------------------- Export functions --------------------
})
}
+function quitOneFriend (url, accessToken, friendId, expectedStatus, end) {
+ if (!end) {
+ end = expectedStatus
+ expectedStatus = 204
+ }
+
+ const path = '/api/v1/pods/' + friendId
+
+ request(url)
+ .delete(path)
+ .set('Accept', 'application/json')
+ .set('Authorization', 'Bearer ' + accessToken)
+ .expect(expectedStatus)
+ .end(function (err, res) {
+ if (err) throw err
+
+ end()
+ })
+}
+
// ---------------------------------------------------------------------------
module.exports = podsUtils