summaryrefslogtreecommitdiff
path: root/http/uploads_config_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'http/uploads_config_test.go')
-rw-r--r--http/uploads_config_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/http/uploads_config_test.go b/http/uploads_config_test.go
index e2de97f2..7704a486 100644
--- a/http/uploads_config_test.go
+++ b/http/uploads_config_test.go
@@ -3,6 +3,7 @@ package http
import (
"testing"
"github.com/stretchr/testify/assert"
+ "os"
)
func TestFsConfig_Forbids(t *testing.T) {
@@ -13,3 +14,11 @@ func TestFsConfig_Forbids(t *testing.T) {
assert.True(t, cfg.Forbids("phpadmin/index.bak.php"))
assert.False(t, cfg.Forbids("index.html"))
}
+
+func TestFsConfig_TmpFallback(t *testing.T) {
+ cfg := UploadsConfig{Dir: "test"}
+ assert.Equal(t, "test", cfg.TmpDir())
+
+ cfg = UploadsConfig{Dir: ""}
+ assert.Equal(t, os.TempDir(), cfg.TmpDir())
+}