forked from strongloop/loopback
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
701 additions
and
711 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,17 +10,17 @@ var USER = {email: '[email protected]', password: 'test'}; | |
var CURRENT_USER = {email: '[email protected]', password: 'test'}; | ||
var debug = require('debug')('loopback:test:access-control.integration'); | ||
|
||
describe('access control - integration', function () { | ||
describe('access control - integration', function() { | ||
|
||
lt.beforeEach.withApp(app); | ||
|
||
/* | ||
describe('accessToken', function() { | ||
// it('should be a sublcass of AccessToken', function () { | ||
// it('should be a sublcass of AccessToken', function() { | ||
// assert(app.models.accessToken.prototype instanceof loopback.AccessToken); | ||
// }); | ||
it('should have a validate method', function () { | ||
it('should have a validate method', function() { | ||
var token = new app.models.accessToken; | ||
assert.equal(typeof token.validate, 'function'); | ||
}); | ||
|
@@ -60,7 +60,7 @@ describe('access control - integration', function () { | |
}); | ||
*/ | ||
|
||
describe('/users', function () { | ||
describe('/users', function() { | ||
|
||
lt.beforeEach.givenModel('user', USER, 'randomUser'); | ||
|
||
|
@@ -70,7 +70,7 @@ describe('access control - integration', function () { | |
|
||
lt.it.shouldBeDeniedWhenCalledAnonymously('GET', urlForUser); | ||
lt.it.shouldBeDeniedWhenCalledUnauthenticated('GET', urlForUser); | ||
lt.it.shouldBeDeniedWhenCalledByUser(CURRENT_USER,'GET', urlForUser); | ||
lt.it.shouldBeDeniedWhenCalledByUser(CURRENT_USER, 'GET', urlForUser); | ||
|
||
lt.it.shouldBeAllowedWhenCalledAnonymously( | ||
'POST', '/api/users', newUserData()); | ||
|
@@ -133,7 +133,7 @@ describe('access control - integration', function () { | |
} | ||
}); | ||
|
||
describe('/banks', function () { | ||
describe('/banks', function() { | ||
lt.beforeEach.givenModel('bank'); | ||
|
||
lt.it.shouldBeAllowedWhenCalledAnonymously('GET', '/api/banks'); | ||
|
@@ -161,13 +161,13 @@ describe('access control - integration', function () { | |
} | ||
}); | ||
|
||
describe('/accounts', function () { | ||
describe('/accounts', function() { | ||
var count = 0; | ||
before(function() { | ||
var roleModel = loopback.getModelByType(loopback.Role); | ||
roleModel.registerResolver('$dummy', function (role, context, callback) { | ||
process.nextTick(function () { | ||
if(context.remotingContext) { | ||
roleModel.registerResolver('$dummy', function(role, context, callback) { | ||
process.nextTick(function() { | ||
if (context.remotingContext) { | ||
count++; | ||
} | ||
callback && callback(null, false); // Always true | ||
|
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
Oops, something went wrong.