Skip to content

Commit

Permalink
More test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Sep 24, 2021
1 parent 6c0fe30 commit 1a61f09
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/relational_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,26 @@ pub async fn linked() -> Result<(), DbErr> {
]
);

let baker_bob = Baker::find()
.filter(baker::Column::Id.eq(1))
.one(&ctx.db)
.await?
.unwrap();

let baker_bob_customers = baker_bob
.find_linked(baker::BakedForCustomer)
.all(&ctx.db)
.await?;

assert_eq!(
baker_bob_customers,
vec![customer::Model {
id: 2,
name: "Kara".to_owned(),
notes: Some("Loves all cakes".to_owned()),
}]
);

ctx.delete().await;

Ok(())
Expand Down

0 comments on commit 1a61f09

Please sign in to comment.