mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 05:15:00 +00:00
Add test assertion where user is not admin of channel
This commit is contained in:
parent
7a04ee3b71
commit
1762d2c6d4
1 changed files with 31 additions and 1 deletions
|
@ -952,7 +952,6 @@ test_both_dbs!(test_channels_postgres, test_channels_sqlite, db, {
|
|||
.unwrap();
|
||||
|
||||
let (channels, _) = db.get_channels_for_user(a_id).await.unwrap();
|
||||
|
||||
assert_eq!(
|
||||
channels,
|
||||
vec![
|
||||
|
@ -1001,6 +1000,37 @@ test_both_dbs!(test_channels_postgres, test_channels_sqlite, db, {
|
|||
]
|
||||
);
|
||||
|
||||
let (channels, _) = db.get_channels_for_user(b_id).await.unwrap();
|
||||
assert_eq!(
|
||||
channels,
|
||||
vec![
|
||||
Channel {
|
||||
id: zed_id,
|
||||
name: "zed".to_string(),
|
||||
parent_id: None,
|
||||
user_is_admin: true,
|
||||
},
|
||||
Channel {
|
||||
id: crdb_id,
|
||||
name: "crdb".to_string(),
|
||||
parent_id: Some(zed_id),
|
||||
user_is_admin: false,
|
||||
},
|
||||
Channel {
|
||||
id: livestreaming_id,
|
||||
name: "livestreaming".to_string(),
|
||||
parent_id: Some(zed_id),
|
||||
user_is_admin: false,
|
||||
},
|
||||
Channel {
|
||||
id: replace_id,
|
||||
name: "replace".to_string(),
|
||||
parent_id: Some(zed_id),
|
||||
user_is_admin: false,
|
||||
},
|
||||
]
|
||||
);
|
||||
|
||||
// Remove a single channel
|
||||
db.remove_channel(crdb_id, a_id).await.unwrap();
|
||||
assert!(db.get_channel(crdb_id, a_id).await.unwrap().is_none());
|
||||
|
|
Loading…
Reference in a new issue