add a couple more tests for optional user

This commit is contained in:
Joe Ardent 2023-06-14 16:00:28 -07:00
parent b59dfb5bf0
commit 0d03ce3d12
1 changed files with 18 additions and 0 deletions

View File

@ -61,4 +61,22 @@ mod test {
fn signup_success_has_no_optional_user() { fn signup_success_has_no_optional_user() {
assert!(!CreateUserSuccess::default().has_optional_user()); assert!(!CreateUserSuccess::default().has_optional_user());
} }
#[test]
fn user_is_not_optional() {
#[derive(Default, OptionalOptionalUser)]
struct TestThing {
user: User,
}
assert!(!TestThing::default().has_optional_user());
}
#[test]
fn user_is_not_user() {
#[derive(Default, OptionalOptionalUser)]
struct TestThing {
user: Option<bool>,
}
assert!(!TestThing::default().has_optional_user());
}
} }