Archived
Notes move both ways, and prove a deleted table takes its cells with it
Two small things found reading it back: a note could be moved up but not down, and nothing exercised `remove` against the real foreign keys — a delete that strands its children fails in Postgres rather than in memory, and it's a button on the screen.
This commit is contained in:
@@ -204,6 +204,22 @@ class CateringMenuTest {
|
||||
.contains("Holiday boxes");
|
||||
}
|
||||
|
||||
@Test
|
||||
void deletingATableTakesItsColumnsLinesAndCellsWithIt() {
|
||||
CateringMenu.PackageView weddings = catering.everything().packages().get(2);
|
||||
|
||||
catering.remove(weddings.id());
|
||||
// Flushed on purpose: a delete that leaves its children behind fails against the real foreign
|
||||
// keys, not in memory, and this one is a button on the admin screen.
|
||||
entityManager.flush();
|
||||
entityManager.clear();
|
||||
|
||||
assertThat(catering.everything().packages()).extracting(CateringMenu.PackageView::name)
|
||||
.containsExactly("Office", "Parties");
|
||||
// The page's own terms outlive any one table.
|
||||
assertThat(catering.menu().notes()).hasSize(2);
|
||||
}
|
||||
|
||||
@Test
|
||||
void putsTheTablesWhereTheEditorLeftThem() {
|
||||
List<CateringMenu.PackageView> tables = catering.everything().packages();
|
||||
|
||||
Reference in New Issue
Block a user