beads/cmd/bd/create_routing_test.go
beads/crew/emma d7629204f9 refactor: remove multi-rig routing from beads
Remove the entire multi-rig routing engine (routes.go, route resolution,
prefix-based dispatch) and cross-rig commands (move, refile). All bd
commands now operate on the local rig only.

Deleted: internal/routing/routes.go, cmd/bd/move.go, cmd/bd/refile.go,
and 5 associated test files.

Simplified: routed.go, close.go, create.go, dep.go, gate.go, list.go,
ready.go, promote.go, show.go, show_display.go.

Retained: contributor routing (routing.go, routing_read.go) is unchanged.

Resolves: bd-8hc5

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 19:53:13 -07:00

48 lines
1.1 KiB
Go

//go:build cgo
package main
import (
"context"
"path/filepath"
"testing"
"github.com/steveyegge/beads/internal/config"
)
func TestGetRoutingConfigValue_DBFallback(t *testing.T) {
initConfigForTest(t)
tmpDir := t.TempDir()
testDB := filepath.Join(tmpDir, ".beads", "beads.db")
s := newTestStore(t, testDB)
ctx := context.Background()
if err := s.SetConfig(ctx, "routing.mode", "auto"); err != nil {
t.Fatalf("failed to set routing.mode in DB: %v", err)
}
got := getRoutingConfigValue(ctx, s, "routing.mode")
if got != "auto" {
t.Fatalf("getRoutingConfigValue() = %q, want %q", got, "auto")
}
}
func TestGetRoutingConfigValue_YAMLPrecedence(t *testing.T) {
initConfigForTest(t)
tmpDir := t.TempDir()
testDB := filepath.Join(tmpDir, ".beads", "beads.db")
s := newTestStore(t, testDB)
ctx := context.Background()
if err := s.SetConfig(ctx, "routing.mode", "auto"); err != nil {
t.Fatalf("failed to set routing.mode in DB: %v", err)
}
config.Set("routing.mode", "maintainer")
got := getRoutingConfigValue(ctx, s, "routing.mode")
if got != "maintainer" {
t.Fatalf("getRoutingConfigValue() = %q, want %q", got, "maintainer")
}
}