Feature user and admin panels (#30)
This commit is contained in:
27
server/handlers/admin_test.go
Normal file
27
server/handlers/admin_test.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestNewSettingsHandler(t *testing.T) {
|
||||
h := NewSettingsHandler()
|
||||
if h == nil {
|
||||
t.Fatal("NewSettingsHandler returned nil")
|
||||
}
|
||||
}
|
||||
|
||||
func TestNewAdminHandler(t *testing.T) {
|
||||
h := NewAdminHandler()
|
||||
if h == nil {
|
||||
t.Fatal("NewAdminHandler returned nil")
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsRegistrationEnabledDefaultsTrue(t *testing.T) {
|
||||
// Without a database connection, should default to true
|
||||
enabled := IsRegistrationEnabled()
|
||||
if !enabled {
|
||||
t.Error("Expected registration enabled by default when no DB")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user