Commit 4087de35 authored by Sean Hammond's avatar Sean Hammond

Add test for failed access token request

parent 480e1bae
......@@ -53,6 +53,18 @@ describe('oauth auth', function () {
});
});
it('should raise if an access token request fails', function () {
fakeHttp.post.returns(Promise.resolve({status: 500}));
return auth.tokenGetter().then(
function onResolved () {
assert(false, 'The Promise should have been rejected');
},
function onRejected (error) {
assert.equal(error.message, 'Failed to retrieve access token');
}
);
});
it('should cache tokens for future use', function () {
return auth.tokenGetter().then(function () {
fakeHttp.post.reset();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment