Skip to content

Instantly share code, notes, and snippets.

@mraible
Created May 21, 2015 16:26
Show Gist options
  • Save mraible/4c01f5ad60e7d7cb6ffb to your computer and use it in GitHub Desktop.
Save mraible/4c01f5ad60e7d7cb6ffb to your computer and use it in GitHub Desktop.
Setting expectations when making direct server calls with Protractor
it('should delete account successfully', function (done) {
req.post({json: true, url: constants.apiHostname() + '/api/v1/login/', form: {username: generatedEmail, password: password}}, function(error, message, body) {
var userId = body.user.id;
expect(userId).not.toBe(null);
req.del(constants.apiHostname() + '/api/v1/users/' + userId, done, function (error, message, body) {
expect(userId).toBe(204);
done();
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment