feat: initialize tenant workbench in shared database
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestValidateRejectsDeprecatedTinodeDatabase(t *testing.T) {
|
||||
cfg := defaultConfig()
|
||||
cfg.MySQL.DSN = "root:root@tcp(127.0.0.1:3306)/tinode?parseTime=true"
|
||||
|
||||
err := cfg.validate()
|
||||
if err == nil || !strings.Contains(err.Error(), "tinode is deprecated") {
|
||||
t.Fatalf("validate() error = %v, want deprecated database error", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDefaultConfigUsesMeetingIMDatabase(t *testing.T) {
|
||||
cfg := defaultConfig()
|
||||
if err := cfg.validate(); err != nil {
|
||||
t.Fatalf("default config validation failed: %v", err)
|
||||
}
|
||||
if !strings.Contains(cfg.MySQL.DSN, "/meeting_im?") {
|
||||
t.Fatalf("default mysql dsn = %q, want meeting_im database", cfg.MySQL.DSN)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user