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:
parent
4bf0bd7b09
commit
e05f9bb963
23 changed files with 473 additions and 28 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue