diff options
Diffstat (limited to 'tests/approve.rs')
| -rw-r--r-- | tests/approve.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/approve.rs b/tests/approve.rs index 1f61182..f1fc762 100644 --- a/tests/approve.rs +++ b/tests/approve.rs @@ -245,6 +245,25 @@ fn reject_requires_a_reason_and_records_it() { }) .unwrap(); assert!(note.contains("license"), "{note}"); + + // And the audit row says *which review* was rejected, not only why (ยง6 m-4): + // the three review actions each hand-built their own `detail`, and two of + // them recorded no identity at all. + let (actor_kind, detail): (String, String) = env + .db + .read(|c| { + Ok(c.query_row( + "SELECT actor_kind, detail_json FROM audit WHERE action='reject' AND entity_id=?1", + rusqlite::params![cid.to_string()], + |r| Ok((r.get(0)?, r.get(1)?)), + )?) + }) + .unwrap(); + assert_eq!(actor_kind, "human"); + assert!( + detail.contains(&c.identity_hash), + "the audit row does not say which review bytes were rejected: {detail}" + ); } // ------------------------------------------------------------- the CLI path -- |
