[Draft] Implement Early deletion by Submitter #37 #38
1 changed files with 21 additions and 1 deletions
add a test for the migration
(currently ignored, due to what I believe is a serde bug)
commit
dc4e18ff0a
|
|
@ -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",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue