test case with two allowed dirs
@@ -117,14 +117,17 @@ fn uploading_files_is_restricted(
/// This tests that we can upload files to the directory specified by --allow-upload-dir
#[rstest]
-#[case(server(&["-u", "--allowed-upload-dir", "someDir"]), "someDir")]
-#[case(server(&["-u", "--allowed-upload-dir", "someDir/some_sub_dir"]), "someDir/some_sub_dir")]
+#[case(server(&["-u", "--allowed-upload-dir", "someDir"]), vec!["someDir"])]
+#[case(server(&["-u", "--allowed-upload-dir", "someDir/some_sub_dir"]), vec!["someDir/some_sub_dir"])]
+#[case(server(&["-u", "--allowed-upload-dir", "someDir/some_sub_dir", "--allowed-upload-dir", "someDir/some_other_dir"]),
+ vec!["someDir/some_sub_dir", "someDir/some_other_dir"])]
fn uploading_files_to_allowed_dir_works(
#[case] server: TestServer,
- #[case] upload_dir: &str,
+ #[case] upload_dirs: Vec<&str>,
) -> Result<(), Error> {
let test_file_name = "uploaded test file.txt";
+ for upload_dir in upload_dirs{
// Create test directory
create_dir_all(server.path().join(upload_dir)).unwrap();
@@ -158,6 +161,7 @@ fn uploading_files_to_allowed_dir_works(
let parsed = Document::from_read(body)?;
assert!(parsed.find(Text).any(|x| x.text() == test_file_name));
+ }
Ok(())
}
