Add comprehensive tests for mentor repository and authentication
- Implemented tests for creating, retrieving, updating, and deleting mentors in `mentor_repository_test.rs`. - Added tests for user authentication, including successful login, invalid email formats, and inactive users in `auth_login_tests.rs`. - Created a mock test environment setup in `mock_test.rs` to facilitate database operations during tests. - Updated module structure to include new test files for mentors and authentication. - Ensured cleanup of the database after tests to maintain isolation and prevent side effects.
This commit is contained in:
@@ -5,6 +5,7 @@ use imphnen_cms::{
|
||||
events_protected_routes, events_public_routes, testimonials_protected_routes,
|
||||
testimonials_public_routes,
|
||||
};
|
||||
use imphnen_dimentorin::dimentorin_router;
|
||||
use imphnen_entities::{AppState, SurrealMemClient, SurrealWsClient};
|
||||
use imphnen_gacha::gacha_router;
|
||||
use imphnen_iam::{iam_protected_routes, iam_public_routes};
|
||||
@@ -32,6 +33,7 @@ pub async fn gateway_service(
|
||||
.merge(iam_protected_routes())
|
||||
.merge(events_protected_routes())
|
||||
.merge(testimonials_protected_routes())
|
||||
.merge(dimentorin_router())
|
||||
.merge(gacha_router())
|
||||
.layer(from_fn(auth_middleware));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user