From 790b5d5e51c64e56bba876978ebb9970b0ce0f03 Mon Sep 17 00:00:00 2001 From: mo khan Date: Wed, 25 Jun 2025 15:42:20 -0600 Subject: test: use build_header function --- tests/common/factory_bot.rs | 6 ------ tests/integration_tests.rs | 5 ++++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/common/factory_bot.rs b/tests/common/factory_bot.rs index a16a1213..f25633f4 100644 --- a/tests/common/factory_bot.rs +++ b/tests/common/factory_bot.rs @@ -42,12 +42,6 @@ pub fn build_headers(headers: Vec<(String, String)>) -> HashMap }); } -pub fn create_headers_with_auth(auth_value: &str) -> HashMap { - return build_with(|item: &mut HashMap| { - item.insert(String::from("authorization"), String::from(auth_value)); - }); -} - pub fn create_token() -> String { return String::from("valid-token"); } diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 41c3bf29..c25d1920 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -39,7 +39,10 @@ async fn test_multiple() { ]; for (auth_value, should_succeed) in test_cases { - let headers = common::factory_bot::create_headers_with_auth(auth_value); + let headers = common::factory_bot::build_headers(vec![( + "authorization".to_string(), + auth_value.to_string(), + )]); let request = common::factory_bot::create_test_request_with_headers(headers); let response = server.check(request).await; -- cgit v1.2.3