Last active
November 27, 2019 08:10
-
-
Save mutaimwiti/224a92671e6f1d5dc366157be513ace2 to your computer and use it in GitHub Desktop.
Using wrapper es5
This file contains 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
// test/article.spec.js | |
var app = require('./testUtils/app'); | |
describe('Articles', function() { | |
describe('GET', function() { | |
it('should not allow unauthenticated users to list all articles', function(done) { | |
app.get('/articles').expect(401, done); | |
}); | |
it('should allow authenticated users to list all articles', function(done) { | |
app.loginRandom(function() { | |
app.get('/articles').then(function(res) { | |
expect(res.body.articles).toEqual('All articles'); | |
app.logout(); | |
done(); | |
}); | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment