-
-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rust): update the postgres schema
- Loading branch information
1 parent
0c4d9cb
commit ce286dc
Showing
21 changed files
with
139 additions
and
397 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,36 +82,40 @@ impl CliState { | |
mod test { | ||
use super::*; | ||
use crate::cloud::subscription::SubscriptionName; | ||
use ockam_node::database::skip_if_postgres; | ||
|
||
#[tokio::test] | ||
async fn test_cli_spaces() -> Result<()> { | ||
let cli = CliState::test().await?; | ||
skip_if_postgres(|| async { | ||
let cli = CliState::test().await?; | ||
|
||
// the first created space becomes the default | ||
let space1 = cli | ||
.store_space( | ||
"1", | ||
"name1", | ||
vec!["[email protected]", "[email protected]"], | ||
Some(&Subscription::new( | ||
SubscriptionName::Gold, | ||
false, | ||
None, | ||
None, | ||
None, | ||
)), | ||
) | ||
.await?; | ||
let result = cli.get_default_space().await?; | ||
assert_eq!(result, space1); | ||
// the first created space becomes the default | ||
let space1 = cli | ||
.store_space( | ||
"1", | ||
"name1", | ||
vec!["[email protected]", "[email protected]"], | ||
Some(&Subscription::new( | ||
SubscriptionName::Gold, | ||
false, | ||
None, | ||
None, | ||
None, | ||
)), | ||
) | ||
.await?; | ||
let result = cli.get_default_space().await?; | ||
assert_eq!(result, space1); | ||
|
||
// the store method can be used to update a space | ||
let updated_space1 = cli | ||
.store_space("1", "name1", vec!["[email protected]"], None) | ||
.await?; | ||
let result = cli.get_default_space().await?; | ||
assert_eq!(result, updated_space1); | ||
// the store method can be used to update a space | ||
let updated_space1 = cli | ||
.store_space("1", "name1", vec!["[email protected]"], None) | ||
.await?; | ||
let result = cli.get_default_space().await?; | ||
assert_eq!(result, updated_space1); | ||
|
||
Ok(()) | ||
Ok(()) | ||
}) | ||
.await | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,12 +218,12 @@ impl UserRow { | |
mod test { | ||
use super::*; | ||
|
||
use ockam_node::database::with_dbs; | ||
use ockam_node::database::with_sqlite_dbs; | ||
use std::sync::Arc; | ||
|
||
#[tokio::test] | ||
async fn test_repository() -> Result<()> { | ||
with_dbs(|db| async move { | ||
with_sqlite_dbs(|db| async move { | ||
let repository: Arc<dyn UsersRepository> = Arc::new(UsersSqlxDatabase::new(db)); | ||
|
||
let my_email_address: EmailAddress = "[email protected]".try_into().unwrap(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.