API-level tests for the /seed-lots route group #88
@@ -163,7 +163,7 @@ func TestSeedLotRemainingIsDerivedAPI(t *testing.T) {
|
|||||||
oid := int64(decodeMap(t, w.Body.Bytes())["id"].(float64))
|
oid := int64(decodeMap(t, w.Body.Bytes())["id"].(float64))
|
||||||
|
|
||||||
// Plant 12 of them against the lot.
|
// 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,
|
"plantId": plantID, "xCm": 0, "yCm": 0, "radiusCm": 20, "count": 12, "seedLotId": lotID,
|
||||||
}, cookie)
|
}, cookie)
|
||||||
if w.Code != http.StatusCreated {
|
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
|
// 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'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.
|
// 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,
|
"plantId": plantID, "xCm": 40, "yCm": 40, "radiusCm": 20, "count": 45, "seedLotId": lotID,
|
||||||
}, cookie)
|
}, cookie)
|
||||||
if w.Code != http.StatusCreated {
|
if w.Code != http.StatusCreated {
|
||||||
|
|||||||
Reference in New Issue
Block a user