Skip to content

Commit

Permalink
fix(lib): Fix delete test to respect other tests
Browse files Browse the repository at this point in the history
Previous to this fix: if `delete` runs before `select` or `update`,
`select` or `update` will fail.
  • Loading branch information
SkylerLipthay committed May 1, 2015
1 parent 84c8a00 commit c888751
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,10 @@ fn delete() {
let cn = pool.get().unwrap();
setup_tables(&*cn);

let mut anakin = (query_model!(
&Jedi::table().select_all().where_(Jedi::name_f().is("Anakin Skywalker".to_string())).first(),
let mut darth = (query_model!(
&Jedi::table().select_all().where_(Jedi::name_f().is("Darth Maul".to_string())).first(),
&*cn, &[]
)).unwrap();

assert_eq!(exec_pg!(&anakin.delete_query(), &*cn, &[]), 1);
assert_eq!(exec_pg!(&darth.delete_query(), &*cn, &[]), 1);
}

0 comments on commit c888751

Please sign in to comment.