diff --git a/test/test.js b/test/test.js index c5bd6e6..15de6b2 100755 --- a/test/test.js +++ b/test/test.js @@ -218,6 +218,23 @@ return done(); done(); } + function addCustomFile(done) { + fs.writeFileSync('/tmp/customfile.txt', 'GOGS TEST', 'utf8'); + execSync('cloudron exec -- mkdir -p /app/data/custom/public'); + execSync('cloudron push /tmp/customfile.txt /app/data/custom/public/customfile.txt'); + fs.unlinkSync('/tmp/customfile.txt'); + done(); + } + + function checkCustomFile(done) { + superagent.get('https://' + app.fqdn + '/customfile.txt').end(function (error, result) { + if (error) return done(error); + + expect(result.text).to.contain('GOGS TEST'); + done(); + }); + } + function fileExists() { expect(fs.existsSync(repodir + '/newfile')).to.be(true); } @@ -294,6 +311,9 @@ return done(); it('can add and push a file', pushFile); it('can edit file', editFile); + it('can add custom file', addCustomFile); + it('can check custom file', checkCustomFile); + it('can restart app', function (done) { execSync('cloudron restart --wait --app ' + app.id); done();