mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-24 18:22:01 +00:00
Amend: tests for populating S3 settings from environment variable
This commit is contained in:
parent
3e1ef3af63
commit
c4e3f9eb02
1 changed files with 22 additions and 0 deletions
22
services/filestore/test/unit/coffee/SettingsTests.coffee
Normal file
22
services/filestore/test/unit/coffee/SettingsTests.coffee
Normal file
|
@ -0,0 +1,22 @@
|
|||
assert = require("chai").assert
|
||||
sinon = require('sinon')
|
||||
chai = require('chai')
|
||||
should = chai.should()
|
||||
expect = chai.expect
|
||||
modulePath = "../../../app/js/BucketController.js"
|
||||
SandboxedModule = require('sandboxed-module')
|
||||
|
||||
describe "Settings", ->
|
||||
describe "s3", ->
|
||||
it "should use JSONified env var if present", (done)->
|
||||
s3_settings =
|
||||
key: 'default_key'
|
||||
secret: 'default_secret'
|
||||
bucket1:
|
||||
auth_key: 'bucket1_key'
|
||||
auth_secret: 'bucket1_secret'
|
||||
process.env['S3_CREDENTIALS'] = JSON.stringify s3_settings
|
||||
|
||||
settings =require('settings-sharelatex')
|
||||
expect(settings.filestore.s3).to.deep.equal s3_settings
|
||||
done()
|
Loading…
Reference in a new issue