test(config): keep web settings inside data dir
This commit is contained in:
parent
b3f8fb69a0
commit
0014910638
|
|
@ -141,6 +141,19 @@ func TestConfirmationPageUsesSharedTemplateAndEscapesToken(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestNewServerSetsConfigPathInsideDataDirectory(t *testing.T) {
|
||||||
|
dir := t.TempDir()
|
||||||
|
cfg := DefaultConfig()
|
||||||
|
s, err := NewServer(dir+"/server.db", dir+"/data", cfg)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
defer s.Close()
|
||||||
|
if !strings.HasPrefix(cfg.path, dir+"/data/") {
|
||||||
|
t.Fatalf("config path escaped data directory: %q", cfg.path)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestWebSessionScopesDoNotCrossAuthorizePages(t *testing.T) {
|
func TestWebSessionScopesDoNotCrossAuthorizePages(t *testing.T) {
|
||||||
s, err := newTestServer(t)
|
s, err := newTestServer(t)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue