An action on a name that is no app answers 404, not 'settings cannot be saved' (found walking capability map B2 on 9202)
gates / gates (push) Successful in 27s
gates / gates (push) Successful in 27s
Test TestAnActionOnANameThatIsNoAppIsA404 red first. Commit only.
This commit is contained in:
1 parent
eed23e7594
commit
20c5877056
4 files changed
+44
-1
No files matched your search
@@ -0,0 +1,29 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// Found walking the capability map's B2 („App lifecycle") on 9202, 2026-10-28 night: a Stop of a name that is no app
|
||||
// on this box (`felhom-controller` — bootstrap-managed, not a stack) answered 500 „…az alkalmazás beállításai nem
|
||||
// menthetők." — the desired-state write's „not found" read as a save failure. It is a 404 now, before any intent is
|
||||
// recorded. RED-PROOF: drop the ErrStackNotFound branch in actionStack → 500 → FAILS.
|
||||
func TestAnActionOnANameThatIsNoAppIsA404(t *testing.T) {
|
||||
r, _, _, _ := newSlice4Router(t)
|
||||
for _, action := range []string{"stop", "start"} {
|
||||
w := httptest.NewRecorder()
|
||||
r.actionStack(w, httptest.NewRequest("POST", "/api/stacks/nosuchapp/"+action, nil), action, "nosuchapp")
|
||||
var resp apiResponse
|
||||
_ = json.Unmarshal(w.Body.Bytes(), &resp)
|
||||
if w.Code != http.StatusNotFound {
|
||||
t.Fatalf("%s of a name that is no app: %d %q — want 404", action, w.Code, resp.Error)
|
||||
}
|
||||
if strings.Contains(strings.ToLower(resp.Error), "mentheto") || strings.Contains(resp.Error, "menthetők") {
|
||||
t.Fatalf("%s: the answer still blames a save: %q", action, resp.Error)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user