1
0
Fork 0
mirror of https://gitlab.com/msrd0/gotham-restful.git synced 2025-04-20 06:54:46 +00:00

a whole bunch of tests for the method macros

This commit is contained in:
Dominic 2020-05-08 18:39:11 +02:00
parent 4bf0bd7b09
commit e05f9bb963
Signed by: msrd0
GPG key ID: DCC8C247452E98F9
23 changed files with 473 additions and 28 deletions

View file

@ -1,7 +1,3 @@
mod custom_request_body
{
use gotham::{
hyper::header::CONTENT_TYPE,
router::builder::*,
@ -10,6 +6,7 @@ use gotham::{
use gotham_restful::*;
use mime::TEXT_PLAIN;
const RESPONSE : &[u8] = b"This is the only valid response.";
#[derive(Resource)]
@ -30,7 +27,7 @@ fn create(body : Foo) -> Raw<Vec<u8>> {
#[test]
fn test()
fn custom_request_body()
{
let server = TestServer::new(build_simple_router(|router| {
router.resource::<FooResource>("foo");
@ -44,6 +41,3 @@ fn test()
let body : &[u8] = res.as_ref();
assert_eq!(body, RESPONSE);
}
}