-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
112 additions
and
6 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 |
---|---|---|
|
@@ -9,7 +9,7 @@ use repology_webapp_test_utils::check_response; | |
migrator = "repology_common::MIGRATOR", | ||
fixtures("common_repositories", "maintainer_data") | ||
)] | ||
async fn test_maintainer(pool: PgPool) { | ||
async fn test_nonexistent(pool: PgPool) { | ||
check_response!( | ||
pool, | ||
"/maintainer/[email protected]", | ||
|
@@ -18,6 +18,13 @@ async fn test_maintainer(pool: PgPool) { | |
html_ok "allow_empty_tags,warnings_fatal", | ||
contains "Unknown maintainer", | ||
); | ||
} | ||
|
||
#[sqlx::test( | ||
migrator = "repology_common::MIGRATOR", | ||
fixtures("common_repositories", "maintainer_data") | ||
)] | ||
async fn test_orphaned(pool: PgPool) { | ||
check_response!( | ||
pool, | ||
"/maintainer/[email protected]", | ||
|
@@ -26,6 +33,13 @@ async fn test_maintainer(pool: PgPool) { | |
html_ok "allow_empty_tags,warnings_fatal", | ||
contains "Gone maintainer", | ||
); | ||
} | ||
|
||
#[sqlx::test( | ||
migrator = "repology_common::MIGRATOR", | ||
fixtures("common_repositories", "maintainer_data") | ||
)] | ||
async fn test_orphaned_in_future(pool: PgPool) { | ||
check_response!( | ||
pool, | ||
"/maintainer/[email protected]", | ||
|
@@ -34,7 +48,13 @@ async fn test_maintainer(pool: PgPool) { | |
html_ok "allow_empty_tags,warnings_fatal", | ||
contains "Gone maintainer", | ||
); | ||
} | ||
|
||
#[sqlx::test( | ||
migrator = "repology_common::MIGRATOR", | ||
fixtures("common_repositories", "maintainer_data") | ||
)] | ||
async fn test_active(pool: PgPool) { | ||
check_response!( | ||
pool, | ||
"/maintainer/[email protected]", | ||
|
@@ -52,6 +72,13 @@ async fn test_maintainer(pool: PgPool) { | |
// not testing similar maintainers for now | ||
// not testing projects list for now | ||
); | ||
} | ||
|
||
#[sqlx::test( | ||
migrator = "repology_common::MIGRATOR", | ||
fixtures("common_repositories", "maintainer_data") | ||
)] | ||
async fn test_fallback(pool: PgPool) { | ||
check_response!( | ||
pool, | ||
"/maintainer/fallback-mnt-foo@repology", | ||
|
@@ -63,6 +90,15 @@ async fn test_maintainer(pool: PgPool) { | |
// contact section | ||
contains_not "mailto:[email protected]", | ||
); | ||
} | ||
|
||
#[sqlx::test( | ||
migrator = "repology_common::MIGRATOR", | ||
fixtures("common_repositories", "maintainer_data") | ||
)] | ||
async fn test_no_vuln_column(pool: PgPool) { | ||
// Maintainer not updated for a long time, without vulnerable projects | ||
// counter filled. | ||
check_response!( | ||
pool, | ||
"/maintainer/[email protected]", | ||
|
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 |
---|---|---|
|
@@ -9,11 +9,46 @@ use super::uri_snapshot_test; | |
migrator = "repology_common::MIGRATOR", | ||
fixtures("common_repositories", "maintainer_data") | ||
)] | ||
async fn test_maintainer(pool: PgPool) { | ||
async fn test_nonexistent(pool: PgPool) { | ||
uri_snapshot_test(pool.clone(), "/maintainer/[email protected]").await; | ||
} | ||
|
||
#[sqlx::test( | ||
migrator = "repology_common::MIGRATOR", | ||
fixtures("common_repositories", "maintainer_data") | ||
)] | ||
async fn test_orphaned(pool: PgPool) { | ||
uri_snapshot_test(pool.clone(), "/maintainer/[email protected]").await; | ||
} | ||
|
||
#[sqlx::test( | ||
migrator = "repology_common::MIGRATOR", | ||
fixtures("common_repositories", "maintainer_data") | ||
)] | ||
async fn test_orphaned_in_future(pool: PgPool) { | ||
uri_snapshot_test(pool.clone(), "/maintainer/[email protected]").await; | ||
} | ||
|
||
#[sqlx::test( | ||
migrator = "repology_common::MIGRATOR", | ||
fixtures("common_repositories", "maintainer_data") | ||
)] | ||
async fn test_active(pool: PgPool) { | ||
uri_snapshot_test(pool.clone(), "/maintainer/[email protected]").await; | ||
} | ||
|
||
#[sqlx::test( | ||
migrator = "repology_common::MIGRATOR", | ||
fixtures("common_repositories", "maintainer_data") | ||
)] | ||
async fn test_fallback(pool: PgPool) { | ||
uri_snapshot_test(pool.clone(), "/maintainer/fallback-mnt-foo@repology").await; | ||
} | ||
|
||
#[sqlx::test( | ||
migrator = "repology_common::MIGRATOR", | ||
fixtures("common_repositories", "maintainer_data") | ||
)] | ||
async fn test_no_vuln_column(pool: PgPool) { | ||
uri_snapshot_test(pool.clone(), "/maintainer/[email protected]").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