weee
This commit is contained in:
@@ -25,6 +25,9 @@ func TestLoadDefaults(t *testing.T) {
|
||||
if cfg.DBPath != "/var/lib/vibesonic/vibesonic.db" {
|
||||
t.Errorf("DBPath = %q, want default under DataDir", cfg.DBPath)
|
||||
}
|
||||
if cfg.CookieSecure {
|
||||
t.Error("CookieSecure = true, want false for the default plain-HTTP server")
|
||||
}
|
||||
if cfg.ExtAuth.Enabled {
|
||||
t.Errorf("ExtAuth.Enabled = true, want false by default")
|
||||
}
|
||||
@@ -33,6 +36,17 @@ func TestLoadDefaults(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadSecureCookiesOptIn(t *testing.T) {
|
||||
t.Setenv("VIBESONIC_COOKIE_SECURE", "true")
|
||||
cfg, err := Load()
|
||||
if err != nil {
|
||||
t.Fatalf("Load: %v", err)
|
||||
}
|
||||
if !cfg.CookieSecure {
|
||||
t.Error("CookieSecure = false, want true when explicitly enabled")
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadMusicDirs(t *testing.T) {
|
||||
withEnv(t, map[string]string{"VIBESONIC_MUSIC_DIRS": "/music:/music-lossless: /audiobooks "})
|
||||
cfg, err := Load()
|
||||
|
||||
Reference in New Issue
Block a user