Last active
July 4, 2016 23:55
-
-
Save jedwood/5311084 to your computer and use it in GitHub Desktop.
API Testing Example - Part 1
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
describe('Authentication', function() { | |
it('errors if wrong basic auth', function(done) { | |
api.get('/blog') | |
.set('x-api-key', '123myapikey') | |
.auth('incorrect', 'credentials') | |
.expect(401, done) | |
}); | |
it('errors if bad x-api-key header', function(done) { | |
api.get('/blog') | |
.auth('correct', 'credentials') | |
.expect(401) | |
.expect({error:"Bad or missing app identification header"}, done); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment