1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-10 02:35:58 +01:00

Add test for upgrading AllowSubgroups.

This commit is contained in:
Juliusz Chroboczek 2024-04-17 18:48:24 +02:00
parent 96f69c0765
commit 19dfccc3d5

View file

@ -59,7 +59,7 @@ func TestEmptyJSON(t *testing.T) {
var descJSON = ` var descJSON = `
{ {
"max-history-age": 10, "max-history-age": 10,
"allow-subgroups": true, "auto-subgroups": true,
"users": { "users": {
"jch": {"password": "topsecret", "permissions": "op"}, "jch": {"password": "topsecret", "permissions": "op"},
"john": {"password": "secret", "permissions": "present"}, "john": {"password": "secret", "permissions": "present"},
@ -125,6 +125,11 @@ func TestUpgradeDescription(t *testing.T) {
t.Fatalf("upgradeDescription: %v", err) t.Fatalf("upgradeDescription: %v", err)
} }
if d1.AutoSubgroups != d2.AutoSubgroups ||
d1.AllowSubgroups != d2.AllowSubgroups {
t.Errorf("AllowSubgroups not upgraded correctly")
}
if d2.Op != nil || d2.Presenter != nil || d2.Other != nil { if d2.Op != nil || d2.Presenter != nil || d2.Other != nil {
t.Errorf("legacy field is not nil") t.Errorf("legacy field is not nil")
} }