Update readme

This commit is contained in:
Blade Barringer 2015-10-30 09:04:19 -05:00
parent aa111b3c1a
commit 6f18470b65

View file

@ -88,13 +88,16 @@ it('makes the party creator the leader automatically', () => {
});
```
If the test is checking that the request returns an error, use the `rejectedWith` syntax.
If the test is checking that the request returns an error, use the `.eventually.be.rejected.and.eql` syntax.
```js
it('returns an error', () => {
let api = requester(user);
return expect(request.get('/groups/id-of-a-party-that-user-does-not-belong-to'))
.to.be.rejectedWith('Group not found or you don\'t have access.');
.to.eventually.be.rejected.and.eql({
code: 404,
text: t('messageGroupNotFound'),
});
});
```