Skip to content

Commit

Permalink
test: add test for non-existent
Browse files Browse the repository at this point in the history
  • Loading branch information
kod-kristoff committed Sep 18, 2024
1 parent 5d623f5 commit 10861fd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions crates/fm-server/tests/api/morph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,23 @@ async fn can_call() -> eyre::Result<()> {

Ok(())
}

#[tokio::test]
async fn non_existent() -> eyre::Result<()> {
// Arrange
let app = TestApp::new().await?;
let client = reqwest::Client::new();

// Act
let response = client.get(app.url("/morph/löparsko/0")?).send().await?;

// Assert
let status_code = response.status();

assert_eq!(status_code, StatusCode::NOT_FOUND);

// let data: serde_json::Value = response.json().await?;
// insta::assert_json_snapshot!(data);

Ok(())
}
Binary file added graph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 10861fd

Please sign in to comment.