testing
This commit is contained in:
parent
4f0af179b1
commit
63d132d83f
1 changed files with 5 additions and 6 deletions
|
|
@ -132,14 +132,14 @@ mod test {
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_receive_activity_hook() {
|
async fn test_receive_activity_hook() {
|
||||||
let (body, incoming_request, config) = setup_receive_test().await;
|
let (body, incoming_request, config) = setup_receive_test().await;
|
||||||
receive_activity_with_hook::<Follow, DbUser, DbConnection, _>(
|
let res = receive_activity_with_hook::<Follow, DbUser, DbConnection, _>(
|
||||||
incoming_request.to_http_request(),
|
incoming_request.to_http_request(),
|
||||||
body,
|
body,
|
||||||
inbox_activity_hook,
|
inbox_activity_hook,
|
||||||
&config.to_request_data(),
|
&config.to_request_data(),
|
||||||
)
|
)
|
||||||
.await
|
.await;
|
||||||
.unwrap();
|
assert_eq!(res.err(), Some(Error::Other("test-error".to_string())));
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn inbox_activity_hook<Activity: ActivityHandler + Send + Sync, ActorT>(
|
async fn inbox_activity_hook<Activity: ActivityHandler + Send + Sync, ActorT>(
|
||||||
|
|
@ -147,9 +147,8 @@ mod test {
|
||||||
_actor: ActorT,
|
_actor: ActorT,
|
||||||
_context: Data<DbConnection>,
|
_context: Data<DbConnection>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
// TODO: test that this actually gets called
|
// ensure that hook gets called by returning this value
|
||||||
//todo!();
|
Err(Error::Other("test-error".to_string()))
|
||||||
Ok(())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue