Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #963 from prose/organization-endpoint
Organization endpoint
- Loading branch information
Showing
6 changed files
with
131 additions
and
71 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
var Orgs = require('../../../app/collections/orgs'); | ||
var User = require('../../../app/models/user'); | ||
var cookie = require('../../../app/cookie'); | ||
|
||
describe('orgs collection', function () { | ||
|
||
var token; | ||
before(function () { | ||
token = cookie.get('oauth-token'); | ||
if (!token) { | ||
cookie.set('oauth-token', '12345'); | ||
} | ||
}); | ||
|
||
after(function () { | ||
if (token) { | ||
cookie.set('oauth-token', token); | ||
} | ||
else { | ||
cookie.unset('oauth-token'); | ||
} | ||
}); | ||
|
||
// https://github.com/prose/prose/issues/826#issuecomment-219456842 | ||
// https://developer.github.com/v3/orgs/#list-your-organizations | ||
// https://developer.github.com/v3/orgs/#list-user-organizations | ||
it('does not use /users/:username/orgs when authenticated', function () { | ||
var user = new User({login: 'tom'}); | ||
var orgs = new Orgs([], {user: user}); | ||
expect(/tom/.test(orgs.url())).not.ok; | ||
}); | ||
}); |