Feature: Dietary preferences As a signed-in user I want my regime and allergies/intolerances to autosave as I edit them So that my preferences are always up to date without an explicit save step Background: Given I am signed in as "Alice" "Martin" And my household id is 1 And my diet id is 2 And the dietary preferences reference data is ready Scenario: Loads the current regime, and shows allergies/intolerances as two groups When I visit "/parametres/preferences" Then the "diet" field should have the value "2" And I should see the section "Allergies" And I should see the section "Intolérances" And the checkbox "Gluten" should be checked And the checkbox "Arachides" should not be checked Scenario: Has no explicit save button anywhere on the page When I visit "/parametres/preferences" Then I should not see "Enregistrer" Scenario: Autosaves the regime as soon as it's selected Given selecting the diet will succeed When I visit "/parametres/preferences" And I select "Omnivore" from the "diet" field Then the diet update request should have been made with diet id 1 Scenario: Autosaves allergies and intolerances together after checking boxes Given updating allergies will succeed When I visit "/parametres/preferences" And I check the checkbox "Arachides" Then the allergies update request should have been made with allergy ids 2 and 1 And I should see "Enregistré ✓"