Update schema_details test to use TestApp::init()
use diesel::prelude::*;
use diesel::sql_types::Text;
-use app;
+use TestApp;
#[test]
fn all_columns_called_crate_id_have_a_cascading_foreign_key() {
@@ -64,11 +64,12 @@ struct TableNameAndConstraint {
fn get_fk_constraint_definitions(column_name: &str) -> Vec<TableNameAndConstraint> {
use diesel::sql_query;
- let (_r, app, _) = app();
- let conn = app.diesel_database.get().unwrap();
+ let (app, _) = TestApp::init().empty();
+ app.db(|conn| {
sql_query(include_str!("load_foreign_key_constraints.sql"))
.bind::<Text, _>(column_name)
- .load(&*conn)
+ .load(conn)
.unwrap()
+ })
}
