You've already forked AstralRinth
forked from didirus/AstralRinth
Taplo and typos in CI, TOML cleanup (#4510)
* Taplo and typos in CI * Clean up Cargo.toml files * Fix CI * Fix CI * Run typos in CI * Loosen typos a bit * Fix typos * Fix taplo * Switch to Tombi * Fix Tombi errors * Remove unused typos config * Tombi fmt * Remove extraneous cargo fmt * fix typos
This commit is contained in:
@@ -129,7 +129,7 @@ impl ApiVersion for ApiV3 {
|
||||
modify_json,
|
||||
);
|
||||
|
||||
// Add a versiom.
|
||||
// Add a version.
|
||||
let req = TestRequest::post()
|
||||
.uri("/v3/version")
|
||||
.append_pat(pat)
|
||||
|
||||
@@ -59,7 +59,7 @@ impl TemporaryDatabase {
|
||||
let database_url =
|
||||
dotenvy::var("DATABASE_URL").expect("No database URL");
|
||||
|
||||
// Create the temporary (and template datbase, if needed)
|
||||
// Create the temporary (and template database, if needed)
|
||||
Self::create_temporary(&database_url, &temp_database_name).await;
|
||||
|
||||
// Pool to the temporary database
|
||||
@@ -102,7 +102,7 @@ impl TemporaryDatabase {
|
||||
}
|
||||
}
|
||||
|
||||
// Creates a template and temporary databse (panics)
|
||||
// Creates a template and temporary database (panics)
|
||||
// 1. Waits to obtain a pg lock on the main database
|
||||
// 2. Creates a new template database called 'TEMPLATE_DATABASE_NAME', if needed
|
||||
// 3. Switches to the template database
|
||||
|
||||
@@ -390,7 +390,7 @@ pub async fn add_project_beta(api: &ApiV3) -> (Project, Version) {
|
||||
}
|
||||
|
||||
pub async fn add_organization_zeta(api: &ApiV3) -> Organization {
|
||||
// Add an organzation.
|
||||
// Add an organization.
|
||||
let req = TestRequest::post()
|
||||
.uri("/v3/organization")
|
||||
.append_pat(USER_USER_PAT)
|
||||
|
||||
@@ -35,7 +35,7 @@ pub struct PermissionsTest<'a, A: Api> {
|
||||
user_pat: Option<&'a str>,
|
||||
|
||||
// Whether or not the user ID should be removed from the project/organization team after the test
|
||||
// (This is mostly reelvant if you are also using an existing project/organization, and want to do
|
||||
// (This is mostly relevant if you are also using an existing project/organization, and want to do
|
||||
// multiple tests with the same user.
|
||||
remove_user: bool,
|
||||
|
||||
@@ -1056,10 +1056,10 @@ async fn create_dummy_org(setup_api: &ApiV3) -> (String, String) {
|
||||
let organization = setup_api
|
||||
.get_organization_deserialized(&slug, ADMIN_USER_PAT)
|
||||
.await;
|
||||
let organizaion_id = organization.id.to_string();
|
||||
let organization_id = organization.id.to_string();
|
||||
let team_id = organization.team_id.to_string();
|
||||
|
||||
(organizaion_id, team_id)
|
||||
(organization_id, team_id)
|
||||
}
|
||||
|
||||
async fn add_project_to_org(
|
||||
|
||||
@@ -61,7 +61,7 @@ pub async fn pat_full_test() {
|
||||
let mock_pat_test = |token: &str| {
|
||||
let token = token.to_string();
|
||||
async {
|
||||
// This uses a route directly instead of an api call because it doesn't relaly matter and we
|
||||
// This uses a route directly instead of an api call because it doesn't really matter and we
|
||||
// want it to succeed no matter what.
|
||||
// This is an arbitrary request.
|
||||
let req = test::TestRequest::post()
|
||||
|
||||
@@ -419,7 +419,7 @@ pub async fn test_patch_project() {
|
||||
.await;
|
||||
assert_status!(&resp, StatusCode::UNAUTHORIZED);
|
||||
|
||||
// Sucessful request to patch many fields.
|
||||
// Successful request to patch many fields.
|
||||
let resp = api
|
||||
.edit_project(
|
||||
alpha_project_slug,
|
||||
@@ -500,7 +500,7 @@ pub async fn test_patch_v3() {
|
||||
|
||||
let alpha_project_slug = &test_env.dummy.project_alpha.project_slug;
|
||||
|
||||
// Sucessful request to patch many fields.
|
||||
// Successful request to patch many fields.
|
||||
let resp = api
|
||||
.edit_project(
|
||||
alpha_project_slug,
|
||||
@@ -1141,7 +1141,7 @@ async fn permissions_delete_project() {
|
||||
async fn project_permissions_consistency_test() {
|
||||
with_test_environment_all(Some(10), |test_env| async move {
|
||||
// Test that the permissions are consistent with each other
|
||||
// For example, if we get the projectpermissions directly, from an organization's defaults, overriden, etc, they should all be correct & consistent
|
||||
// For example, if we get the projectpermissions directly, from an organization's defaults, overridden, etc, they should all be correct & consistent
|
||||
let api = &test_env.api;
|
||||
// Full project permissions test with EDIT_DETAILS
|
||||
let success_permissions = ProjectPermissions::EDIT_DETAILS;
|
||||
|
||||
@@ -535,7 +535,7 @@ async fn test_patch_organization_team_member() {
|
||||
}).await;
|
||||
}
|
||||
|
||||
// trasnfer ownership (requires being owner, etc)
|
||||
// transfer ownership (requires being owner, etc)
|
||||
#[actix_rt::test]
|
||||
async fn transfer_ownership_v3() {
|
||||
// Test setup and dummy data
|
||||
@@ -675,7 +675,7 @@ async fn transfer_ownership_v3() {
|
||||
// // Adding a user to a project team in an organization, when that user is in the organization but not the team,
|
||||
// // should have those permissions apply regardless of whether the user has accepted the invite or not.
|
||||
|
||||
// // This is because project-team permission overrriding must be possible, and this overriding can decrease the number of permissions a user has.
|
||||
// // This is because project-team permission overriding must be possible, and this overriding can decrease the number of permissions a user has.
|
||||
|
||||
// let test_env = TestEnvironment::build(None).await;
|
||||
// let api = &test_env.api;
|
||||
|
||||
@@ -103,7 +103,7 @@ async fn test_project_type_sanity() {
|
||||
);
|
||||
}
|
||||
|
||||
// As we get more complicated strucures with as v3 continues to expand, and alpha/beta get more complicated, we should add more tests here,
|
||||
// As we get more complicated structures with as v3 continues to expand, and alpha/beta get more complicated, we should add more tests here,
|
||||
// to ensure that projects created with v3 routes are still valid and work with v3 routes.
|
||||
},
|
||||
)
|
||||
@@ -413,7 +413,7 @@ pub async fn test_patch_v2() {
|
||||
|
||||
let alpha_project_slug = &test_env.dummy.project_alpha.project_slug;
|
||||
|
||||
// Sucessful request to patch many fields.
|
||||
// Successful request to patch many fields.
|
||||
let resp = api
|
||||
.edit_project(
|
||||
alpha_project_slug,
|
||||
@@ -433,7 +433,7 @@ pub async fn test_patch_v2() {
|
||||
// Note: the original V2 value of this was "optional",
|
||||
// but Required/Optional is no longer a carried combination in v3, as the changes made were lossy.
|
||||
// Now, the test Required/Unsupported combination is tested instead.
|
||||
// Setting Required/Optional in v2 will not work, this is known and accepteed.
|
||||
// Setting Required/Optional in v2 will not work, this is known and accepted.
|
||||
assert_eq!(project.client_side.as_str(), "unsupported");
|
||||
assert_eq!(project.server_side.as_str(), "required");
|
||||
},
|
||||
|
||||
@@ -15,7 +15,7 @@ use crate::{
|
||||
},
|
||||
};
|
||||
|
||||
// trasnfer ownership (requires being owner, etc)
|
||||
// transfer ownership (requires being owner, etc)
|
||||
#[actix_rt::test]
|
||||
async fn transfer_ownership_v2() {
|
||||
// Test setup and dummy data
|
||||
|
||||
@@ -56,7 +56,7 @@ pub async fn test_patch_version() {
|
||||
assert_status!(&resp, StatusCode::BAD_REQUEST);
|
||||
}
|
||||
|
||||
// Sucessful request to patch many fields.
|
||||
// Successful request to patch many fields.
|
||||
let resp = api
|
||||
.edit_version(
|
||||
alpha_version_id,
|
||||
|
||||
@@ -3,7 +3,7 @@ pub mod common;
|
||||
// Not all tests expect exactly the same functionality in v2 and v3.
|
||||
// For example, though we expect the /GET version to return the corresponding project,
|
||||
// we may want to do different checks for each.
|
||||
// (such as checking client_side in v2, but loader fields on v3- which are model-exclusie)
|
||||
// (such as checking client_side in v2, but loader fields on v3- which are model-exclusive)
|
||||
|
||||
// Such V2 tests are exported here
|
||||
mod v2 {
|
||||
|
||||
@@ -439,7 +439,7 @@ pub async fn test_patch_version() {
|
||||
assert_status!(&resp, StatusCode::BAD_REQUEST);
|
||||
}
|
||||
|
||||
// Sucessful request to patch many fields.
|
||||
// Successful request to patch many fields.
|
||||
let resp = api
|
||||
.edit_version(
|
||||
alpha_version_id,
|
||||
|
||||
Reference in New Issue
Block a user