federation-api: Move create_join_event::v1 test as integration test

Otherwise cargo check always complains that we are using
a deprecated const.
See https://github.com/rust-lang/rust/issues/47238
This commit is contained in:
Kévin Commaille 2023-05-25 12:46:31 +02:00 committed by Kévin Commaille
parent 9dd55ae3bc
commit 631c4e6733
4 changed files with 21 additions and 21 deletions

View File

@ -109,24 +109,3 @@ impl RoomState {
Self { auth_chain: Vec::new(), state: Vec::new(), event: None }
}
}
#[allow(deprecated)]
#[cfg(all(test, feature = "server", not(feature = "unstable-unspecified")))]
mod tests {
use ruma_common::api::OutgoingResponse;
use serde_json::{from_slice as from_json_slice, json, Value as JsonValue};
use super::{Response, RoomState};
#[test]
fn response_body() {
let res = Response::new(RoomState::new("ORIGIN".to_owned()))
.try_into_http_response::<Vec<u8>>()
.unwrap();
assert_eq!(
from_json_slice::<JsonValue>(res.body()).unwrap(),
json!([200, { "auth_chain": [], "origin": "ORIGIN", "state": [] }])
);
}
}

View File

@ -0,0 +1,19 @@
#[allow(deprecated)]
#[cfg(all(feature = "server", not(feature = "unstable-unspecified")))]
mod v1 {
use ruma_common::api::OutgoingResponse;
use ruma_federation_api::membership::create_join_event::v1::{Response, RoomState};
use serde_json::{from_slice as from_json_slice, json, Value as JsonValue};
#[test]
fn response_body() {
let res = Response::new(RoomState::new("ORIGIN".to_owned()))
.try_into_http_response::<Vec<u8>>()
.unwrap();
assert_eq!(
from_json_slice::<JsonValue>(res.body()).unwrap(),
json!([200, { "auth_chain": [], "origin": "ORIGIN", "state": [] }])
);
}
}

View File

@ -0,0 +1 @@
mod create_join_event;

View File

@ -0,0 +1 @@
mod membership;