Created
November 17, 2014 15:58
-
-
Save aaronshaf/5dff8fcaadbde4c971c8 to your computer and use it in GitHub Desktop.
Testing with mocha, a custom fixture utility, ES6 destructuring, and ES7 async/await
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe('as a super administrator', function() { | |
| it('create a session', async function(done) { | |
| var { | |
| user, | |
| password | |
| } = await fixtures(['User'], { | |
| user: { superAdministrator: true } | |
| }) | |
| request(app) | |
| .post('/api/sessions') | |
| .set('Content-Type', 'application/json') | |
| .send({ | |
| username: user.username, | |
| password: password | |
| }) | |
| .expect(200) | |
| .end(done) | |
| }) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment