Skip to content

Instantly share code, notes, and snippets.

@BlaShadow
Forked from jedwood/sample-test-2.js
Created May 3, 2014 02:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BlaShadow/4ccaa2a8648b3985f356 to your computer and use it in GitHub Desktop.
Save BlaShadow/4ccaa2a8648b3985f356 to your computer and use it in GitHub Desktop.
describe('/blog', function() {
it('returns blog posts as JSON', function(done) {
api.get('/blog')
.set('x-api-key', '123myapikey')
.auth('correct', 'credentials')
.expect(200)
.expect('Content-Type', /json/)
.end(function(err, res) {
if (err) return done(err);
res.body.should.have.property('posts').and.be.instanceof(Array);
done();
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment