about summary refs log tree commit diff stats
path: root/crates/rocie-server/tests/recipies
diff options
context:
space:
mode:
Diffstat (limited to 'crates/rocie-server/tests/recipies')
-rw-r--r--crates/rocie-server/tests/recipies/mod.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/crates/rocie-server/tests/recipies/mod.rs b/crates/rocie-server/tests/recipies/mod.rs
new file mode 100644
index 0000000..e8aa3c2
--- /dev/null
+++ b/crates/rocie-server/tests/recipies/mod.rs
@@ -0,0 +1,24 @@
+use rocie_client::{
+    apis::{api_get_recipe_api::recipe_by_id, api_set_recipe_api::add_recipe},
+    models::RecipeStub,
+};
+
+use crate::testenv::{TestEnv, init::function_name, log::request};
+
+#[tokio::test]
+async fn test_recipe_roundtrip() {
+    let env = TestEnv::new(function_name!());
+
+    let recipe_id = request!(
+        env,
+        add_recipe(RecipeStub {
+            path: "/asia/curry".to_owned(),
+            content: "just make the curry".to_owned(),
+        })
+    );
+
+    let output = request!(env, recipe_by_id(recipe_id));
+
+    assert_eq!(output.path, "/asia/curry".to_owned());
+    assert_eq!(output.content, "just make the curry".to_owned());
+}