feat(role): role bind
This commit is contained in:
@@ -4,8 +4,8 @@ use sqlx::PgPool;
|
||||
use uuid::Uuid;
|
||||
|
||||
#[tokio::test]
|
||||
async fn set_user_roles_is_idempotent_and_validates_tenant_roles(
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
async fn set_user_roles_is_idempotent_and_validates_tenant_roles()
|
||||
-> Result<(), Box<dyn std::error::Error>> {
|
||||
let database_url = match std::env::var("DATABASE_URL") {
|
||||
Ok(v) if !v.trim().is_empty() => v,
|
||||
_ => return Ok(()),
|
||||
@@ -42,6 +42,7 @@ async fn set_user_roles_is_idempotent_and_validates_tenant_roles(
|
||||
name: "R1".into(),
|
||||
description: Some("role1".into()),
|
||||
},
|
||||
user_id,
|
||||
)
|
||||
.await?;
|
||||
let role2 = role_service
|
||||
@@ -51,6 +52,7 @@ async fn set_user_roles_is_idempotent_and_validates_tenant_roles(
|
||||
name: "R2".into(),
|
||||
description: Some("role2".into()),
|
||||
},
|
||||
user_id,
|
||||
)
|
||||
.await?;
|
||||
|
||||
@@ -80,6 +82,7 @@ async fn set_user_roles_is_idempotent_and_validates_tenant_roles(
|
||||
name: "Other".into(),
|
||||
description: None,
|
||||
},
|
||||
user_id,
|
||||
)
|
||||
.await?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user