Update tests to set secret key so they work on release

This commit is contained in:
Matthew Pomes 2024-08-10 00:36:13 -05:00 committed by Sergio Benitez
parent 82430041b3
commit f803288f75
1 changed files with 6 additions and 2 deletions

View File

@ -1,7 +1,8 @@
#[macro_use]
extern crate rocket;
use rocket::{build, fairing::AdHoc, Build, Orbit, Rocket};
use figment::Figment;
use rocket::{custom, fairing::AdHoc, Build, Orbit, Rocket, config::SecretKey};
struct AsyncDropInAsync;
@ -16,7 +17,10 @@ impl Drop for AsyncDropInAsync {
}
fn rocket() -> Rocket<Build> {
build().manage(AsyncDropInAsync).attach(AdHoc::on_liftoff(
let mut config = rocket::Config::default();
config.secret_key = SecretKey::generate().unwrap();
let figment = Figment::from(config);
custom(figment).manage(AsyncDropInAsync).attach(AdHoc::on_liftoff(
"Shutdown immediately",
|rocket: &Rocket<Orbit>| {
Box::pin(async {