MCPcopy Index your code
hub / github.com/coder/coder / TestDefaultOrg

Function TestDefaultOrg

coderd/database/querier_test.go:2552–2569  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2550}
2551
2552func TestDefaultOrg(t *testing.T) {
2553 t.Parallel()
2554 if testing.Short() {
2555 t.SkipNow()
2556 }
2557
2558 sqlDB := testSQLDB(t)
2559 err := migrations.Up(sqlDB)
2560 require.NoError(t, err)
2561 db := database.New(sqlDB)
2562 ctx := context.Background()
2563
2564 // Should start with the default org
2565 all, err := db.GetOrganizations(ctx, database.GetOrganizationsParams{})
2566 require.NoError(t, err)
2567 require.Len(t, all, 1)
2568 require.True(t, all[0].IsDefault, "first org should always be default")
2569}
2570
2571func TestAuditLogDefaultLimit(t *testing.T) {
2572 t.Parallel()

Callers

nothing calls this directly

Calls 6

UpFunction · 0.92
NewFunction · 0.92
SkipNowMethod · 0.80
testSQLDBFunction · 0.70
GetOrganizationsMethod · 0.65
LenMethod · 0.45

Tested by

no test coverage detected