mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
revert/redo tests for api/index, log and Node_spec
This commit is contained in:
@@ -27,7 +27,7 @@ describe("api index", function() {
|
||||
|
||||
describe("disables editor", function() {
|
||||
before(function() {
|
||||
settings.init({disableEditor:true,adminAuth:{type: "credentials",users:[],default:{permissions:"read"}}});
|
||||
settings.init({disableEditor:true});
|
||||
app = express();
|
||||
api.init(app);
|
||||
});
|
||||
@@ -50,6 +50,34 @@ describe("api index", function() {
|
||||
.get("/settings")
|
||||
.expect(200,done)
|
||||
});
|
||||
it('does not serve auth', function(done) {
|
||||
request(app)
|
||||
.get("/auth/login")
|
||||
.expect(404,done)
|
||||
});
|
||||
});
|
||||
|
||||
describe("can serve auth", function() {
|
||||
before(function() {
|
||||
//settings.init({disableEditor:true});
|
||||
settings.init({adminAuth:{type: "credentials",users:[],default:{permissions:"read"}}});
|
||||
app = express();
|
||||
api.init(app);
|
||||
});
|
||||
after(function() {
|
||||
settings.reset();
|
||||
});
|
||||
|
||||
it('it now serves auth', function(done) {
|
||||
request(app)
|
||||
.get("/auth/login")
|
||||
.expect(200)
|
||||
.end(function(err,res) {
|
||||
if (err) { return done(err); }
|
||||
res.body.type.should.equal("credentials");
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("enables editor", function() {
|
||||
|
Reference in New Issue
Block a user