We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 799bce9 commit 43473eaCopy full SHA for 43473ea
rust/signed_doc/src/validator/rules/content_type.rs
@@ -216,4 +216,18 @@ mod tests {
216
let doc = Builder::new().build();
217
assert!(matches!(json_rule.check(&doc).await, Ok(false)));
218
}
219
+
220
+ #[tokio::test]
221
+ async fn content_type_not_specified_rule_test() {
222
+ let content_type = ContentType::Json;
223
+ let rule = ContentTypeRule::NotSpecified;
224
225
+ let doc = Builder::new()
226
+ .with_metadata_field(SupportedField::ContentType(content_type))
227
+ .build();
228
+ assert!(!rule.check(&doc).await.unwrap());
229
230
+ let doc = Builder::new().build();
231
+ assert!(rule.check(&doc).await.unwrap());
232
+ }
233
0 commit comments