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]
|
||||
async fn test_cross_profile_uniqueness_and_link_isolation(#[future] pool: PgPool) {
|
||||
let pool = pool.await;
|
||||
|
||||
// Profile A: foo
|
||||
post_table_definition(
|
||||
&pool,
|
||||
PostTableDefinitionRequest {
|
||||
post_table_definition(&pool, PostTableDefinitionRequest {
|
||||
profile_name: "A".into(),
|
||||
table_name: "foo".into(),
|
||||
columns: vec![ColumnDefinition { name: "col".into(), field_type: "text".into() }], // Added this
|
||||
..Default::default()
|
||||
},
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
}).await.unwrap();
|
||||
|
||||
// Profile B: foo, bar
|
||||
post_table_definition(
|
||||
&pool,
|
||||
PostTableDefinitionRequest {
|
||||
post_table_definition(&pool, PostTableDefinitionRequest {
|
||||
profile_name: "B".into(),
|
||||
table_name: "foo".into(),
|
||||
columns: vec![ColumnDefinition { name: "col".into(), field_type: "text".into() }], // Added this
|
||||
..Default::default()
|
||||
},
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
post_table_definition(
|
||||
&pool,
|
||||
PostTableDefinitionRequest {
|
||||
}).await.unwrap();
|
||||
|
||||
post_table_definition(&pool, PostTableDefinitionRequest {
|
||||
profile_name: "B".into(),
|
||||
table_name: "bar".into(),
|
||||
columns: vec![ColumnDefinition { name: "col".into(), field_type: "text".into() }], // Added this
|
||||
..Default::default()
|
||||
},
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
}).await.unwrap();
|
||||
|
||||
// A linking to B.bar → NotFound
|
||||
let err = post_table_definition(
|
||||
&pool,
|
||||
PostTableDefinitionRequest {
|
||||
let err = post_table_definition(&pool, PostTableDefinitionRequest {
|
||||
profile_name: "A".into(),
|
||||
table_name: "linker".into(),
|
||||
columns: vec![ColumnDefinition { name: "col".into(), field_type: "text".into() }], // Added this
|
||||
links: vec![TableLink {
|
||||
linked_table_name: "bar".into(),
|
||||
required: false,
|
||||
}],
|
||||
..Default::default()
|
||||
},
|
||||
)
|
||||
.await
|
||||
.unwrap_err();
|
||||
}).await.unwrap_err();
|
||||
|
||||
assert_eq!(err.code(), Code::NotFound);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user