Fixed typo
This commit is contained in:
parent
26e091ab15
commit
554aa3436c
1 changed files with 10 additions and 10 deletions
|
@ -141,10 +141,10 @@ pub fn overwrite<T>(db: &T, new_config: &Config) -> Result<()>
|
||||||
where T: ConnectionSource
|
where T: ConnectionSource
|
||||||
{
|
{
|
||||||
reset(db)?;
|
reset(db)?;
|
||||||
ammend(db, new_config)
|
amend(db, new_config)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn ammend<T>(db: &T, new_config: &Config) -> Result<()>
|
pub fn amend<T>(db: &T, new_config: &Config) -> Result<()>
|
||||||
where T: ConnectionSource
|
where T: ConnectionSource
|
||||||
{
|
{
|
||||||
let connection = db.get_connection();
|
let connection = db.get_connection();
|
||||||
|
@ -233,8 +233,8 @@ fn _get_test_db(name: &str) -> DB {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_ammend() {
|
fn test_amend() {
|
||||||
let db = _get_test_db("ammend.sqlite");
|
let db = _get_test_db("amend.sqlite");
|
||||||
|
|
||||||
let initial_config = Config {
|
let initial_config = Config {
|
||||||
album_art_pattern: Some("file\\.png".into()),
|
album_art_pattern: Some("file\\.png".into()),
|
||||||
|
@ -274,17 +274,17 @@ fn test_ammend() {
|
||||||
users[0].password = "".into();
|
users[0].password = "".into();
|
||||||
}
|
}
|
||||||
|
|
||||||
ammend(&db, &initial_config).unwrap();
|
amend(&db, &initial_config).unwrap();
|
||||||
ammend(&db, &new_config).unwrap();
|
amend(&db, &new_config).unwrap();
|
||||||
let db_config = read(&db).unwrap();
|
let db_config = read(&db).unwrap();
|
||||||
assert_eq!(db_config, expected_config);
|
assert_eq!(db_config, expected_config);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_ammend_preserve_password_hashes() {
|
fn test_amend_preserve_password_hashes() {
|
||||||
use self::users::dsl::*;
|
use self::users::dsl::*;
|
||||||
|
|
||||||
let db = _get_test_db("ammend_preserve_password_hashes.sqlite");
|
let db = _get_test_db("amend_preserve_password_hashes.sqlite");
|
||||||
let initial_hash: Vec<u8>;
|
let initial_hash: Vec<u8>;
|
||||||
let new_hash: Vec<u8>;
|
let new_hash: Vec<u8>;
|
||||||
|
|
||||||
|
@ -298,7 +298,7 @@ fn test_ammend_preserve_password_hashes() {
|
||||||
}]),
|
}]),
|
||||||
ydns: None,
|
ydns: None,
|
||||||
};
|
};
|
||||||
ammend(&db, &initial_config).unwrap();
|
amend(&db, &initial_config).unwrap();
|
||||||
|
|
||||||
{
|
{
|
||||||
let connection = db.get_connection();
|
let connection = db.get_connection();
|
||||||
|
@ -325,7 +325,7 @@ fn test_ammend_preserve_password_hashes() {
|
||||||
}]),
|
}]),
|
||||||
ydns: None,
|
ydns: None,
|
||||||
};
|
};
|
||||||
ammend(&db, &new_config).unwrap();
|
amend(&db, &new_config).unwrap();
|
||||||
|
|
||||||
{
|
{
|
||||||
let connection = db.get_connection();
|
let connection = db.get_connection();
|
||||||
|
|
Loading…
Add table
Reference in a new issue