Truncate the temp db before running test_complete_index. Should close #17.

This commit is contained in:
Jordan Petridis 2017-11-24 20:31:10 +02:00
parent 4a195eb1b7
commit d9ef4fed53
No known key found for this signature in database
GPG Key ID: CEABAD9F5683B9A6
2 changed files with 13 additions and 2 deletions

View File

@ -43,8 +43,8 @@ test:stable:
image: "rust"
script:
- rustc --version && cargo --version
- cargo build --all
- cargo test -j 1 --all --verbose
- cargo build
- cargo test -j 1 --verbose
test:nightly:
# Nightly

View File

@ -142,6 +142,7 @@ mod tests {
use rss;
use models::Source;
use database::connection;
use std::fs;
use std::io::BufReader;
@ -191,6 +192,16 @@ mod tests {
),
];
{
// Reset the database into a clean state.
// Test share a Temp file db I think.
let db = connection();
let con = db.get().unwrap();
con.execute("DELETE FROM episode").unwrap();
con.execute("DELETE FROM podcast").unwrap();
con.execute("DELETE FROM source").unwrap();
}
let mut feeds: Vec<_> = urls.iter()
.map(|&(path, url)| {
// Create and insert a Source into db