Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Maciej Wójcik committed Aug 17, 2023
1 parent ced94ca commit 3704850
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ impl DefGuardConfig {
pub fn new_test_config() -> Self {
let mut config = Self::parse_from::<[_; 0], String>([]);
config.validate_rp_id();
config.validate_cookie_domain();
config
}

Expand Down
3 changes: 2 additions & 1 deletion tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use defguard::{
db::{init_db, AppEvent, DbPool, GatewayEvent, User},
grpc::{GatewayMap, WorkerState},
};
use defguard::{db::UserDetails, mail::Mail};
use defguard::{db::UserDetails, mail::Mail, SERVER_CONFIG};
use rocket::http::Status;
use rocket::local::asynchronous::Client;
use sqlx::{postgres::PgConnectOptions, query, types::Uuid};
Expand All @@ -17,6 +17,7 @@ use tokio::sync::mpsc::unbounded_channel;

pub async fn init_test_db() -> (DbPool, DefGuardConfig) {
let config = DefGuardConfig::new_test_config();
let _ = SERVER_CONFIG.set(config.clone());
let opts = PgConnectOptions::new()
.host(&config.database_host)
.port(config.database_port)
Expand Down

0 comments on commit 3704850

Please sign in to comment.