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:
parent
9dd55ae3bc
commit
631c4e6733
@ -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": [] }])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -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": [] }])
|
||||
);
|
||||
}
|
||||
}
|
1
crates/ruma-federation-api/tests/membership/mod.rs
Normal file
1
crates/ruma-federation-api/tests/membership/mod.rs
Normal file
@ -0,0 +1 @@
|
||||
mod create_join_event;
|
1
crates/ruma-federation-api/tests/tests.rs
Normal file
1
crates/ruma-federation-api/tests/tests.rs
Normal file
@ -0,0 +1 @@
|
||||
mod membership;
|
Loading…
x
Reference in New Issue
Block a user