| 218 | |
| 219 | #[test] |
| 220 | fn add_grant_request_serializes_snake_case() { |
| 221 | let req = AddGrantRequest { |
| 222 | subject_type: GrantSubjectType::Team, |
| 223 | subject_id: Uuid::nil(), |
| 224 | relation: GrantRelation::Write, |
| 225 | }; |
| 226 | let json = serde_json::to_string(&req).unwrap(); |
| 227 | assert!(json.contains("\"subject_type\""), "got: {json}"); |
| 228 | assert!(json.contains("\"subject_id\""), "got: {json}"); |
| 229 | assert!(json.contains("\"relation\":\"write\""), "got: {json}"); |
| 230 | } |
| 231 | |
| 232 | #[test] |
| 233 | fn add_grant_request_user_relation_read() { |