From 4c4abe23c6a0a3cc1ed5c9f497b2eb9d0f55cb1e Mon Sep 17 00:00:00 2001 From: Steve Dudenhoeffer Date: Tue, 21 Jul 2026 22:06:57 -0400 Subject: [PATCH] Use objectPlantingsPath helper instead of inline URL (#88) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gadfly: I was wrong that no plantings-path helper existed — objectPlantingsPath is defined in plantings_test.go in the same package. Use it for the two planting POSTs in the remaining test. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01H3zbym8Doka2d7D48maSgZ --- internal/api/seed_lots_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/api/seed_lots_test.go b/internal/api/seed_lots_test.go index 332a353..55735a6 100644 --- a/internal/api/seed_lots_test.go +++ b/internal/api/seed_lots_test.go @@ -163,7 +163,7 @@ func TestSeedLotRemainingIsDerivedAPI(t *testing.T) { oid := int64(decodeMap(t, w.Body.Bytes())["id"].(float64)) // Plant 12 of them against the lot. - w = doJSON(t, r, http.MethodPost, objectPath(oid)+"/plantings", map[string]any{ + w = doJSON(t, r, http.MethodPost, objectPlantingsPath(oid), map[string]any{ "plantId": plantID, "xCm": 0, "yCm": 0, "radiusCm": 20, "count": 12, "seedLotId": lotID, }, cookie) if w.Code != http.StatusCreated { @@ -183,7 +183,7 @@ func TestSeedLotRemainingIsDerivedAPI(t *testing.T) { // NEGATIVE. That's deliberate — the number is a derived truth about what // you've committed, not a floor clamped at zero, and "you've planted more than // you bought" is exactly the signal a gardener wants rather than a hidden -7. - w = doJSON(t, r, http.MethodPost, objectPath(oid)+"/plantings", map[string]any{ + w = doJSON(t, r, http.MethodPost, objectPlantingsPath(oid), map[string]any{ "plantId": plantID, "xCm": 40, "yCm": 40, "radiusCm": 20, "count": 45, "seedLotId": lotID, }, cookie) if w.Code != http.StatusCreated {