@@ -2,7 +2,7 @@ use guild_backend::application::dtos::profile_dtos::ProfileResponse;
22use guild_backend:: infrastructure:: repositories:: postgres_project_repository:: PostgresProjectRepository ;
33use guild_backend:: presentation:: api:: { test_api, AppState } ;
44use serde_json:: json;
5- use std:: sync:: Arc ;
5+ use std:: sync:: Arc ;
66use tokio:: net:: TcpListener ;
77
88#[ tokio:: test]
@@ -24,7 +24,7 @@ async fn valid_github_handle_works() {
2424 let state = AppState {
2525 profile_repository,
2626 project_repository,
27- auth_service : std:: sync:: Arc :: new ( auth_service) , // ← WRAP IN Arc
27+ auth_service : std:: sync:: Arc :: new ( auth_service) ,
2828 } ;
2929 let app = test_api ( state) ;
3030
@@ -54,7 +54,6 @@ async fn valid_github_handle_works() {
5454 . await
5555 . unwrap ( ) ;
5656
57- // Accept either 200 or 201
5857 assert_eq ! ( create_resp. status( ) , reqwest:: StatusCode :: CREATED ) ;
5958
6059 let body = create_resp. json :: < serde_json:: Value > ( ) . await . unwrap ( ) ;
@@ -95,7 +94,7 @@ async fn invalid_format_rejected() {
9594 let state = AppState {
9695 profile_repository,
9796 project_repository,
98- auth_service : std:: sync:: Arc :: new ( auth_service) , // ← WRAP IN Arc
97+ auth_service : std:: sync:: Arc :: new ( auth_service) ,
9998 } ;
10099 let app = test_api ( state) ;
101100
@@ -124,7 +123,6 @@ async fn invalid_format_rejected() {
124123 . send ( )
125124 . await
126125 . unwrap ( ) ;
127- // Similar acceptance for create
128126 assert_eq ! (
129127 create_resp. status( ) ,
130128 reqwest:: StatusCode :: CREATED ,
@@ -147,7 +145,6 @@ async fn invalid_format_rejected() {
147145
148146 assert_eq ! ( update_resp. status( ) , reqwest:: StatusCode :: BAD_REQUEST ) ;
149147
150- // Optionally, try parse message if provided
151148 if let Ok ( err_json) = update_resp. json :: < serde_json:: Value > ( ) . await {
152149 let msg = err_json[ "error" ] . as_str ( ) . unwrap_or ( "" ) ;
153150 assert ! ( msg. contains( "Invalid GitHub handle" ) ) ;
@@ -173,7 +170,7 @@ async fn conflict_case_insensitive() {
173170 let state = AppState {
174171 profile_repository,
175172 project_repository,
176- auth_service : std:: sync:: Arc :: new ( auth_service) , // ← WRAP IN Arc
173+ auth_service : std:: sync:: Arc :: new ( auth_service) ,
177174 } ;
178175 let app = test_api ( state) ;
179176
@@ -258,4 +255,4 @@ async fn conflict_case_insensitive() {
258255 let msg = err_json[ "error" ] . as_str ( ) . unwrap_or ( "" ) ;
259256 assert ! ( msg. contains( "already taken" ) ) ;
260257 }
261- }
258+ }
0 commit comments