Skip to content

Commit d704a83

Browse files
Copilottikazyq
andcommitted
test: clarify validation fixture and path handling
Co-authored-by: tikazyq <[email protected]>
1 parent 1ab8eaa commit d704a83

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

rust/leanspec-http/tests/integration_tests.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ priority: medium
113113
tags:
114114
- invalid
115115
depends_on:
116-
- ""
116+
- "" # intentionally empty to trigger validation error
117117
---
118118
119119
# Invalid Spec
@@ -236,7 +236,7 @@ async fn test_add_project_and_get_detail() {
236236
app.clone(),
237237
"POST",
238238
"/api/projects",
239-
&serde_json::json!({ "path": temp_dir.path() }).to_string(),
239+
&serde_json::json!({ "path": temp_dir.path().to_string_lossy() }).to_string(),
240240
)
241241
.await;
242242

@@ -368,7 +368,7 @@ async fn test_switch_project_and_refresh_cleanup() {
368368
app.clone(),
369369
"POST",
370370
"/api/projects",
371-
&serde_json::json!({ "path": first_project.path() }).to_string(),
371+
&serde_json::json!({ "path": first_project.path().to_string_lossy() }).to_string(),
372372
)
373373
.await;
374374
let first_id = serde_json::from_str::<Value>(&body).unwrap()["id"]
@@ -380,7 +380,7 @@ async fn test_switch_project_and_refresh_cleanup() {
380380
app.clone(),
381381
"POST",
382382
"/api/projects",
383-
&serde_json::json!({ "path": second_project.path() }).to_string(),
383+
&serde_json::json!({ "path": second_project.path().to_string_lossy() }).to_string(),
384384
)
385385
.await;
386386
let second_id = serde_json::from_str::<Value>(&body).unwrap()["id"]
@@ -399,6 +399,7 @@ async fn test_switch_project_and_refresh_cleanup() {
399399
assert_eq!(switched["id"], first_id);
400400

401401
assert!(fs::remove_dir_all(second_project.path()).is_ok());
402+
std::thread::sleep(std::time::Duration::from_millis(10));
402403
assert!(!second_project.path().exists());
403404
let (status, body) = make_request(app.clone(), "POST", "/api/projects/refresh").await;
404405
assert_eq!(status, StatusCode::OK);

0 commit comments

Comments
 (0)