From 61cb75969e7c4ed51a9ab72b7f24056e1382d65b Mon Sep 17 00:00:00 2001 From: Christian Legnitto <LegNeato@users.noreply.github.com> Date: Wed, 8 Jul 2020 16:40:34 -1000 Subject: [PATCH] Move and enable public api integration tests (#692) --- integration_tests/juniper_tests/src/api.rs | 12 ++++++++++++ integration_tests/juniper_tests/src/lib.rs | 2 ++ juniper/test/graph_ql_request.rs | 10 ---------- 3 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 integration_tests/juniper_tests/src/api.rs delete mode 100644 juniper/test/graph_ql_request.rs diff --git a/integration_tests/juniper_tests/src/api.rs b/integration_tests/juniper_tests/src/api.rs new file mode 100644 index 00000000..fcfd895e --- /dev/null +++ b/integration_tests/juniper_tests/src/api.rs @@ -0,0 +1,12 @@ +#[test] +fn operation_name_is_public() { + use juniper::{http::GraphQLRequest, DefaultScalarValue}; + + let request = GraphQLRequest::<DefaultScalarValue>::new( + "query".to_string(), + Some("name".to_string()), + None, + ); + + assert_eq!(request.operation_name(), Some("name")); +} diff --git a/integration_tests/juniper_tests/src/lib.rs b/integration_tests/juniper_tests/src/lib.rs index 62662744..17105046 100644 --- a/integration_tests/juniper_tests/src/lib.rs +++ b/integration_tests/juniper_tests/src/lib.rs @@ -1,4 +1,6 @@ #[cfg(test)] +mod api; +#[cfg(test)] mod codegen; #[cfg(test)] mod custom_scalar; diff --git a/juniper/test/graph_ql_request.rs b/juniper/test/graph_ql_request.rs deleted file mode 100644 index 89c7c8a5..00000000 --- a/juniper/test/graph_ql_request.rs +++ /dev/null @@ -1,10 +0,0 @@ -extern crate juniper; - -#[test] -fn pub_operation_name() { - use juniper::http::GraphQLRequest; - - let request = GraphQLRequest::new("query".to_string(), Some("name".to_string()), None); - - assert_eq!(request.operation_name(), Some("name")); -}