fix: update to reflect groups as tagging

This commit is contained in:
Orion Kindel 2023-07-16 16:03:15 -04:00
parent 190dad39b6
commit 055088d11e
Signed by untrusted user who does not match committer: orion
GPG Key ID: 6D4165AE4C928719
2 changed files with 21 additions and 21 deletions

2
api

@ -1 +1 @@
Subproject commit 46eaa4958691bb0b94fa985d5844a26eac29e93f
Subproject commit 74701aa0c5bd96c4efc323d3031825be879a6988

View File

@ -31,16 +31,16 @@ pub fn user_signup() {
let rep_json =
serde_json::from_slice::<serde_json::Value>(rep.data().payload().as_bytes()).unwrap();
let signup_link = rep_json.as_object()
.unwrap()
.get("links")
.unwrap()
.as_object()
.unwrap()
.get("user_signup")
.unwrap()
.as_str()
.unwrap();
let groups = rep_json.as_object()
.unwrap()
.get("links")
.unwrap()
.as_object()
.unwrap()
.get("groups")
.unwrap()
.as_str()
.unwrap();
let session = rep_json.as_object()
.unwrap()
@ -49,8 +49,8 @@ pub fn user_signup() {
.as_str()
.unwrap();
let get_signup =
Message::builder(Type::Con, Code::GET).path(signup_link)
let get_groups =
Message::builder(Type::Con, Code::GET).path(groups)
.accept(ContentFormat::Json)
.content_format(ContentFormat::Json)
.payload(serde_json::to_vec(&serde_json::json!({
@ -58,7 +58,7 @@ pub fn user_signup() {
})).unwrap())
.build();
let get_signup = Addrd(get_signup, fx.api_addr);
let get_signup = Addrd(get_groups, fx.api_addr);
let rep = nb::block!({
std::thread::sleep(std::time::Duration::from_millis(100));
@ -70,11 +70,11 @@ pub fn user_signup() {
let rep_json =
serde_json::from_slice::<serde_json::Value>(rep.data().payload().as_bytes()).unwrap();
let status = rep_json.as_object()
.unwrap()
.get("status")
.unwrap()
.as_str()
.unwrap();
assert_eq!(status, "email_verification_pending");
let unverified_email =
rep_json.as_array().unwrap().iter().any(|g| {
g.as_object().unwrap().get("tag").unwrap().as_str()
== Some("unverified_email")
});
assert!(unverified_email);
}