chatdesk-ui/auth_v2.169.0/internal/models/db_test.go

25 lines
500 B
Go

package models
import (
"testing"
"github.com/gobuffalo/pop/v6"
"github.com/stretchr/testify/assert"
)
func TestTableNameNamespacing(t *testing.T) {
cases := []struct {
expected string
value interface{}
}{
{expected: "audit_log_entries", value: []*AuditLogEntry{}},
{expected: "refresh_tokens", value: []*RefreshToken{}},
{expected: "users", value: []*User{}},
}
for _, tc := range cases {
m := &pop.Model{Value: tc.value}
assert.Equal(t, tc.expected, m.TableName())
}
}