TestDisableUserNotFound: an unknown user yields 404 and does not fan out.
(t *testing.T)
| 156 | |
| 157 | // TestDisableUserNotFound: an unknown user yields 404 and does not fan out. |
| 158 | func TestDisableUserNotFound(t *testing.T) { |
| 159 | fetcher := &fakePeerFetcher{} |
| 160 | users := &fakeUserAdmin{notFound: true} |
| 161 | r := killSwitchRouter(&fakeLiveInfo{}, fetcher, users) |
| 162 | |
| 163 | code, _ := doPost(t, r, "/api/v1/orgs/acme/users/ghost/disable") |
| 164 | if code != http.StatusNotFound { |
| 165 | t.Fatalf("expected 404 for unknown user, got %d", code) |
| 166 | } |
| 167 | if fetcher.postCallCount() != 0 { |
| 168 | t.Fatalf("a 404 disable must not fan out") |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | // TestDisableEnableUnavailableWithoutUserAdmin: without a UserAdmin wired (nil), |
| 173 | // disable/enable degrade to 503 rather than panicking. |
nothing calls this directly
no test coverage detected