[Draft] Implement Early deletion by Submitter #37 #38

Merged
ben merged 15 commits from ben/Jobboerse:main into main 2023-01-28 18:00:00 +01:00
Showing only changes of commit dc4e18ff0a - Show all commits

add a test for the migration

(currently ignored, due to what I believe is a serde bug)
Bennet Bleßmann 2022-10-09 01:27:16 +02:00 committed by Bennet Bleßmann
Signed by: ben
GPG key ID: 3BE1A1A3CBC3CF99

View file

@ -936,10 +936,30 @@ impl Deref for MutBorrowedJobOffer<'_, '_, '_> {
mod test {
use std::path::PathBuf;
use super::JobOffer;
use super::{JobOffer, JobOfferStatus};
#[test]
fn joboffers_can_be_serialized() -> Result<(), toml::ser::Error> {
toml::ser::to_string_pretty(&JobOffer::<PathBuf>::new_for_test()).map(|_| ())
}
#[test]
#[ignore = "this appears to be a serde bug see https://github.com/serde-rs/serde/issues/2294"]
fn v1_should_not_deserialize_as_current() {
let old = super::V1JobOfferStatus {
review_status: super::ReviewStatus::AwaitingReview,
confirmation_status: super::V1ConfirmationStatus::AwaitingConfirmation {
token: "Test".to_string(),
},
};
let serialized = toml::ser::to_string_pretty(&old)
.expect("testing serialization is not the goal of this test");
println!("{}", serialized);
toml::de::from_str::<'_, JobOfferStatus>(&serialized).expect_err(
"V1 should not parse as current, this will prevent migration from applying",
);
}
}