Permalink
Browse files

Cover profile URL by unit tests.

  • Loading branch information...
1 parent 2e630d0 commit ebb82482d084ce14c90cfc85bc75d0d3df99cbe5 @jaredhanson committed Apr 10, 2013
Showing with 6 additions and 3 deletions.
  1. +6 −3 test/strategy-test.js
@@ -30,9 +30,12 @@ vows.describe('GitHubStrategy').addBatch({
// mock
strategy._oauth2.get = function(url, accessToken, callback) {
- var body = '{ "login": "octocat", "id": 1, "name": "monalisa octocat", "email": "octocat@github.com", "html_url": "https://github.com/octocat" }';
-
- callback(null, body, undefined);
+ if (url == 'https://api.github.com/user') {
+ var body = '{ "login": "octocat", "id": 1, "name": "monalisa octocat", "email": "octocat@github.com", "html_url": "https://github.com/octocat" }';
+ callback(null, body, undefined);
+ } else {
+ callback(new Error('Incorrect user profile URL'));
+ }
}
return strategy;

0 comments on commit ebb8248

Please sign in to comment.