Skip to content

Instantly share code, notes, and snippets.

@Fiyiin
Created March 19, 2019 18:51
Show Gist options
  • Save Fiyiin/9b85b3a1d56c30bff655b26c44855058 to your computer and use it in GitHub Desktop.
Save Fiyiin/9b85b3a1d56c30bff655b26c44855058 to your computer and use it in GitHub Desktop.
A gist to demo tests for the medium.com codebase
describe('To Unfollow a User ', () => {
it('should return the user profile object', (done) => {
request(app)
.delete('/api/profiles/:username/follow')
.set('Authorization', 'JWT')
.expect('Content-Type', /json/)
.expect(200)
.expect((res) => {
expect(res.body).toEqual(
{
"profile": {
"username": "jake",
"bio": "I work at statefarm",
"image": "image-link",
"following": false
}
}
);
});
.end(done)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment