Feature: Household As a signed-in user I want to name my household, invite others to it, and manage its members So that my whole household can share the same planning Scenario: A visitor without a session cannot read the household When I send a GET request to "/house/current" Then the response status should be 401 And the response error code should be "NOT_AUTHENTICATED" Scenario: A signed-in user creates a household Given a profile already exists with email "alice@example.com" and password "correct-horse-battery-staple" And I log in with email "alice@example.com" and password "correct-horse-battery-staple" When I create a household named "Chez Alice" Then the response status should be 201 And my household should be named "Chez Alice" Scenario: A signed-in user renames their household Given a profile already exists with email "alice@example.com" and password "correct-horse-battery-staple" And I log in with email "alice@example.com" and password "correct-horse-battery-staple" And I have a household named "Foyer de test" When I rename my household to "Chez les Martin" Then the response status should be 200 And my household should be named "Chez les Martin" Scenario: A second user joins a household using its invite code Given a profile already exists with email "alice@example.com" and password "correct-horse-battery-staple" And I log in with email "alice@example.com" and password "correct-horse-battery-staple" And I have a household named "Chez Alice" And a profile already exists with email "bob@example.com" and password "correct-horse-battery-staple" When the second user logs in with email "bob@example.com" and password "correct-horse-battery-staple" And the second user joins my household using its invite code Then the second user's response status should be 200 And the second user should be a member of my household Scenario: A non-admin member cannot delete the household Given a profile already exists with email "alice@example.com" and password "correct-horse-battery-staple" And I log in with email "alice@example.com" and password "correct-horse-battery-staple" And I have a household named "Chez Alice" And a profile already exists with email "bob@example.com" and password "correct-horse-battery-staple" And the second user logs in with email "bob@example.com" and password "correct-horse-battery-staple" And the second user joins my household using its invite code When the second user tries to delete the household Then the second user's response status should be 403 And the second user's response error code should be "NOT_HOUSE_ADMIN" Scenario: Adminship transfers to the remaining member when the admin leaves Given a profile already exists with email "alice@example.com" and password "correct-horse-battery-staple" And I log in with email "alice@example.com" and password "correct-horse-battery-staple" And I have a household named "Chez Alice" And a profile already exists with email "bob@example.com" and password "correct-horse-battery-staple" And the second user logs in with email "bob@example.com" and password "correct-horse-battery-staple" And the second user joins my household using its invite code When I leave the household Then the response status should be 204 And the second user should be the household's admin Scenario: The admin removes a member Given a profile already exists with email "alice@example.com" and password "correct-horse-battery-staple" And I log in with email "alice@example.com" and password "correct-horse-battery-staple" And I have a household named "Chez Alice" And a profile already exists with email "bob@example.com" and password "correct-horse-battery-staple" And the second user logs in with email "bob@example.com" and password "correct-horse-battery-staple" And the second user joins my household using its invite code When I remove the second user from my household Then the response status should be 200 And the second user should have no household