changing test for a huge change in a project
This commit is contained in:
@@ -307,54 +307,42 @@ async fn test_self_referential_link(#[future] pool: PgPool) {
|
|||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_cross_profile_uniqueness_and_link_isolation(#[future] pool: PgPool) {
|
async fn test_cross_profile_uniqueness_and_link_isolation(#[future] pool: PgPool) {
|
||||||
let pool = pool.await;
|
let pool = pool.await;
|
||||||
|
|
||||||
// Profile A: foo
|
// Profile A: foo
|
||||||
post_table_definition(
|
post_table_definition(&pool, PostTableDefinitionRequest {
|
||||||
&pool,
|
profile_name: "A".into(),
|
||||||
PostTableDefinitionRequest {
|
table_name: "foo".into(),
|
||||||
profile_name: "A".into(),
|
columns: vec![ColumnDefinition { name: "col".into(), field_type: "text".into() }], // Added this
|
||||||
table_name: "foo".into(),
|
..Default::default()
|
||||||
..Default::default()
|
}).await.unwrap();
|
||||||
},
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
// Profile B: foo, bar
|
// Profile B: foo, bar
|
||||||
post_table_definition(
|
post_table_definition(&pool, PostTableDefinitionRequest {
|
||||||
&pool,
|
profile_name: "B".into(),
|
||||||
PostTableDefinitionRequest {
|
table_name: "foo".into(),
|
||||||
profile_name: "B".into(),
|
columns: vec![ColumnDefinition { name: "col".into(), field_type: "text".into() }], // Added this
|
||||||
table_name: "foo".into(),
|
..Default::default()
|
||||||
..Default::default()
|
}).await.unwrap();
|
||||||
},
|
|
||||||
)
|
post_table_definition(&pool, PostTableDefinitionRequest {
|
||||||
.await
|
profile_name: "B".into(),
|
||||||
.unwrap();
|
table_name: "bar".into(),
|
||||||
post_table_definition(
|
columns: vec![ColumnDefinition { name: "col".into(), field_type: "text".into() }], // Added this
|
||||||
&pool,
|
..Default::default()
|
||||||
PostTableDefinitionRequest {
|
}).await.unwrap();
|
||||||
profile_name: "B".into(),
|
|
||||||
table_name: "bar".into(),
|
|
||||||
..Default::default()
|
|
||||||
},
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
// A linking to B.bar → NotFound
|
// A linking to B.bar → NotFound
|
||||||
let err = post_table_definition(
|
let err = post_table_definition(&pool, PostTableDefinitionRequest {
|
||||||
&pool,
|
profile_name: "A".into(),
|
||||||
PostTableDefinitionRequest {
|
table_name: "linker".into(),
|
||||||
profile_name: "A".into(),
|
columns: vec![ColumnDefinition { name: "col".into(), field_type: "text".into() }], // Added this
|
||||||
table_name: "linker".into(),
|
links: vec![TableLink {
|
||||||
links: vec![TableLink {
|
linked_table_name: "bar".into(),
|
||||||
linked_table_name: "bar".into(),
|
required: false,
|
||||||
required: false,
|
}],
|
||||||
}],
|
..Default::default()
|
||||||
..Default::default()
|
}).await.unwrap_err();
|
||||||
},
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
.unwrap_err();
|
|
||||||
assert_eq!(err.code(), Code::NotFound);
|
assert_eq!(err.code(), Code::NotFound);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user