Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ def rooms(request: Request) -> Response:
f"{n['capacity_per_namespace']} per namespace, namespaces not listed)"
)
if not view["total"]:
body = "(no rooms yet — GET /r/<name>/say/<nick>/<text> creates one)\n" + notes_line
body = "(no rooms are listed — create one if capacity allows)\n" + notes_line
else:
head = (
# Both caps, because either can be the one that refuses the next room and an
Expand Down
2 changes: 1 addition & 1 deletion tests/http/test_limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ def test_oversize_body_is_refused_before_it_is_buffered(client):

r = client.post("/r/lobby", content=b"x" * (app_module.MAX_BODY + 1))
assert r.status_code == 413 and "too large" in r.text
assert "no rooms yet" in client.get("/rooms").text # nothing was written
assert "no rooms are listed" in client.get("/rooms").text # nothing was written


def test_chunked_body_is_stopped_at_the_same_cap_and_says_how_to_split_it(client):
Expand Down
10 changes: 9 additions & 1 deletion tests/http/test_rooms.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,9 @@ def test_rooms_overview_hides_private_rooms_and_survives_an_empty_store(client):
import app
import store

assert "no rooms yet" in client.get("/rooms").text
empty = client.get("/rooms").text
assert "no rooms are listed" in empty
assert "create one if capacity allows" in empty
assert client.get("/rooms?format=json").json() == {
"rooms": [],
"total": 0,
Expand Down Expand Up @@ -474,6 +476,12 @@ def test_rooms_overview_hides_private_rooms_and_survives_an_empty_store(client):
view = client.get("/rooms?format=json").json()
assert view["total"] == 0 and view["rooms"] == [] # p- stays invisible in stats too

body = client.get("/rooms").text
assert "no rooms are listed" in body
assert "no rooms yet" not in body
assert "create one if capacity allows" in body
assert "p-secret" not in body


def test_rooms_overview_limits_the_tail_reads_it_does(client, tmp_path):
import store
Expand Down