Merge pull request #170 from strongloop/feature/add-app-isAuthEnabled

Add app.isAuthEnabled.
This commit is contained in:
Miroslav Bajtoš 2014-02-05 19:33:17 +01:00
commit a506ced005
2 changed files with 11 additions and 1 deletions

View File

@ -305,7 +305,9 @@ app.enableAuth = function() {
next();
}
});
}
this.isAuthEnabled = true;
};
/**
* Initialize an application from an options object or a set of JSON and JavaScript files.

View File

@ -400,6 +400,14 @@ describe('app', function() {
});
});
describe('enableAuth', function() {
it('should set app.isAuthEnabled to true', function() {
expect(app.isAuthEnabled).to.not.equal(true);
app.enableAuth();
expect(app.isAuthEnabled).to.equal(true);
});
});
describe('app.get("/", loopback.status())', function () {
it('should return the status of the application', function (done) {
var app = loopback();