mirror of
https://github.com/maplibre/martin.git
synced 2024-12-26 08:26:13 +03:00
21 lines
547 B
Rust
21 lines
547 B
Rust
extern crate iron;
|
|
extern crate iron_test;
|
|
extern crate martin_lib;
|
|
|
|
use std::env;
|
|
use iron::Headers;
|
|
use iron_test::{request, response};
|
|
|
|
#[test]
|
|
fn test_index() {
|
|
let conn_string: String = env::var("DATABASE_URL")
|
|
.expect("DATABASE_URL must be set");
|
|
|
|
let chain = martin_lib::chain(conn_string);
|
|
|
|
let headers = Headers::new();
|
|
let response = request::get("http://localhost:3000/index.json", headers, &chain).unwrap();
|
|
|
|
let result_body = response::extract_body_to_bytes(response);
|
|
assert_eq!(result_body, b"{}");
|
|
} |