2019-05-29 05:21:06 -04:00
|
|
|
/* eslint-disable
|
|
|
|
handle-callback-err,
|
|
|
|
no-return-assign,
|
|
|
|
no-unused-vars,
|
|
|
|
*/
|
|
|
|
// TODO: This file was created by bulk-decaffeinate.
|
|
|
|
// Fix any style issues and re-enable lint.
|
|
|
|
/*
|
|
|
|
* decaffeinate suggestions:
|
|
|
|
* DS102: Remove unnecessary code created because of implicit returns
|
|
|
|
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
|
|
|
*/
|
|
|
|
const Settings = require('settings-sharelatex')
|
|
|
|
const chai = require('chai')
|
|
|
|
const request = require('./helpers/request')
|
|
|
|
|
|
|
|
describe('siteIsOpen', function() {
|
2019-08-07 10:04:04 -04:00
|
|
|
describe('when siteIsOpen is default (true)', function() {
|
|
|
|
it('should get page', function(done) {
|
|
|
|
return request.get('/login', (error, response, body) => {
|
2019-05-29 05:21:06 -04:00
|
|
|
response.statusCode.should.equal(200)
|
|
|
|
return done()
|
2019-08-07 10:04:04 -04:00
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
2019-05-29 05:21:06 -04:00
|
|
|
|
2019-06-21 09:46:09 -04:00
|
|
|
describe('when siteIsOpen is false', function() {
|
2019-08-07 10:04:04 -04:00
|
|
|
beforeEach(function() {
|
|
|
|
return (Settings.siteIsOpen = false)
|
|
|
|
})
|
2019-05-29 05:21:06 -04:00
|
|
|
|
2019-08-07 10:04:04 -04:00
|
|
|
afterEach(function() {
|
|
|
|
return (Settings.siteIsOpen = true)
|
|
|
|
})
|
2019-05-29 05:21:06 -04:00
|
|
|
|
2019-08-07 10:04:04 -04:00
|
|
|
it('should return maintenance page', function(done) {
|
|
|
|
return request.get('/login', (error, response) => {
|
2019-05-29 05:21:06 -04:00
|
|
|
response.statusCode.should.equal(503)
|
|
|
|
return done()
|
2019-08-07 10:04:04 -04:00
|
|
|
})
|
|
|
|
})
|
2019-05-29 05:21:06 -04:00
|
|
|
})
|
|
|
|
})
|