Preserve file-only content when archiving.

This commit is contained in:
2026-07-21 22:04:03 +02:00
parent 1c04087471
commit 89a07c885a
14 changed files with 219 additions and 52 deletions

View File

@@ -126,6 +126,19 @@ fn reopened_draft_generation_uses_last_published_file() {
assert_eq!(source.body_markdown, "Published body");
}
#[test]
fn archived_post_with_published_file_is_not_a_generation_source() {
let (_db, dir) = setup();
let mut post = make_post("archived", 1_710_000_000_000);
write_published_snapshot(&dir, &mut post, "Published body");
post.status = PostStatus::Archived;
post.content = None;
let source = load_published_post_source(dir.path(), post).unwrap();
assert!(source.is_none());
}
#[test]
fn validation_keeps_reopened_draft_published_snapshots() {
let (db, dir) = setup();