Skip to content

Commit

Permalink
Cover profile URL by unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed Apr 10, 2013
1 parent 2e630d0 commit ebb8248
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/strategy-test.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ vows.describe('GitHubStrategy').addBatch({


// mock // mock
strategy._oauth2.get = function(url, accessToken, callback) { 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" }'; 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); callback(null, body, undefined);
} else {
callback(new Error('Incorrect user profile URL'));
}
} }


return strategy; return strategy;
Expand Down

0 comments on commit ebb8248

Please sign in to comment.