use dialtone_common::rest::users::user_exchanges::PutUserSysData; use dialtone_common::rest::users::web_user::UserSystemData; use dialtone_reqwest::api_v1::users::change_sysdata::change_user_sysdata; use dialtone_test_util::create_system::create_system_tst_utl; use dialtone_test_util::test_action; use dialtone_test_util::test_constants::{TEST_NOROLEUSER_ACCT, TEST_PASSWORD, TEST_USERADMIN_NAME}; use dialtone_test_util::test_pg::test_pg; use dialtone_test_util::test_server::start_test_srv_and_auth; #[tokio::test] #[allow(non_snake_case)] async fn GIVEN_useradmin_WHEN_put_user_sysdata_THEN_success() { test_pg(move |pool| async move { // GIVEN useradmin create_system_tst_utl(&pool).await; let sc = start_test_srv_and_auth(pool, TEST_USERADMIN_NAME, TEST_PASSWORD).await; // WHEN put_user_data let request = PutUserSysData { acct: TEST_NOROLEUSER_ACCT.to_string(), sysinfo: UserSystemData {}, }; let action = change_user_sysdata(&sc, &request).await; // THEN success test_action!(action); assert!(action.unwrap()); }) .await; }