2019-12-16 06:20:29 -05:00
|
|
|
const chai = require('chai')
|
|
|
|
const { expect } = chai
|
2018-07-06 06:05:40 -04:00
|
|
|
|
2020-01-07 04:46:53 -05:00
|
|
|
describe('Settings', function() {
|
|
|
|
describe('s3', function() {
|
|
|
|
it('should use JSONified env var if present', function() {
|
|
|
|
const s3Settings = {
|
2019-12-16 06:20:22 -05:00
|
|
|
bucket1: {
|
2019-12-16 06:20:29 -05:00
|
|
|
auth_key: 'bucket1_key',
|
|
|
|
auth_secret: 'bucket1_secret'
|
2019-12-16 06:20:22 -05:00
|
|
|
}
|
2019-12-16 06:20:29 -05:00
|
|
|
}
|
2020-01-07 04:46:53 -05:00
|
|
|
process.env.S3_BUCKET_CREDENTIALS = JSON.stringify(s3Settings)
|
2018-07-06 06:05:40 -04:00
|
|
|
|
2019-12-16 06:20:29 -05:00
|
|
|
const settings = require('settings-sharelatex')
|
2020-01-07 04:46:53 -05:00
|
|
|
expect(settings.filestore.s3BucketCreds).to.deep.equal(s3Settings)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|