ruwuma/crates/ruma-common/tests/it/api/default_status.rs
Jonas Platte 7051892077 Move integration tests one directory level deeper
… and rename from tests to it (integration tests).
This allows enabling the mod_module_files lint everywhere again.
2024-09-11 07:13:32 +00:00

34 lines
756 B
Rust

#![allow(clippy::exhaustive_structs)]
use http::StatusCode;
use ruma_common::{
api::{request, response, Metadata, OutgoingResponse as _},
metadata,
};
const METADATA: Metadata = metadata! {
method: GET,
rate_limited: false,
authentication: None,
history: {
unstable => "/_matrix/my/endpoint",
}
};
/// Request type for the `default_status` endpoint.
#[request]
pub struct Request {}
/// Response type for the `default_status` endpoint.
#[response]
pub struct Response {}
#[test]
fn response_default_status() {
let res = Response {};
let http_res = res.try_into_http_response::<Vec<u8>>().unwrap();
// Test that we correctly changed the status code.
assert_eq!(http_res.status(), StatusCode::OK);
}