Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ env:

jobs:
check:
uses: ShuttlePub/workflows/.github/workflows/check.yml@a95cf7631a550a66628dd4a2a8d6ef4d253edab4
uses: ShuttlePub/workflows/.github/workflows/check.yml@5be8e4cbb4f1f1616dc88316d469f3b13b059445
with:
workspace: '[ "kernel", "application", "server" ]'
check-driver:
uses: ShuttlePub/workflows/.github/workflows/test-psql.yml@454354614b775cd3b470c991b532e8db1c1ed89f
uses: ShuttlePub/workflows/.github/workflows/test-psql.yml@5be8e4cbb4f1f1616dc88316d469f3b13b059445
with:
workspace: driver
openapi-check:
Expand All @@ -30,5 +30,5 @@ jobs:
- name: Check for uncommitted diff
run: git diff --exit-code openapi.json
coverage:
uses: ShuttlePub/workflows/.github/workflows/coverage.yml@d4c43ec23ffeaf5538fc32bdf63aa5e042ccee61
uses: ShuttlePub/workflows/.github/workflows/coverage.yml@5be8e4cbb4f1f1616dc88316d469f3b13b059445
secrets: inherit
26 changes: 14 additions & 12 deletions application/src/service/organization/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -827,18 +827,20 @@ async fn owner_changes_active_member_role_to_admin() {
#[tokio::test]
async fn owner_removes_active_member() {
let f = fixture(1);
let accounts = f.module.accounts.values.lock().unwrap();
let org = accounts
.iter()
.find(|account| account.nanoid().as_ref() == "org")
.unwrap()
.clone();
let owner = accounts
.iter()
.find(|account| account.nanoid().as_ref() == "owner")
.unwrap()
.clone();
drop(accounts);
let (org, owner) = {
let accounts = f.module.accounts.values.lock().unwrap();
let org = accounts
.iter()
.find(|account| account.nanoid().as_ref() == "org")
.unwrap()
.clone();
let owner = accounts
.iter()
.find(|account| account.nanoid().as_ref() == "owner")
.unwrap()
.clone();
(org, owner)
};
f.module
.memberships
.0
Expand Down
6 changes: 3 additions & 3 deletions application/src/service/profile_transfer/cancel/tests.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::*;
use crate::service::profile_transfer::test_support::{fixture, Fixture};
use crate::service::profile_transfer::test_support::fixture;
use kernel::prelude::entity::{
AccountId, AccountKind, EventVersion, Nanoid, ProfileTransferRequest, ProfileTransferStatus,
};
Expand All @@ -8,7 +8,7 @@ use kernel::KernelError;

#[tokio::test]
async fn cancel_succeeds_when_actor_owns_from_account() {
let mut f = fixture();
let f = fixture();
f.module
.cancel_profile_transfer_request(&f.auth, f.request_nanoid.clone())
.await
Expand Down Expand Up @@ -89,7 +89,7 @@ async fn cancel_returns_not_found_for_unknown_request() {

#[tokio::test]
async fn cancel_updates_read_model() {
let mut f = fixture();
let f = fixture();
f.module
.cancel_profile_transfer_request(&f.auth, f.request_nanoid.clone())
.await
Expand Down
2 changes: 1 addition & 1 deletion application/src/service/profile_transfer/request/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ async fn request_returns_permission_denied_when_actor_does_not_own_profile() {

#[tokio::test]
async fn request_returns_permission_denied_when_owner_not_active_member() {
let mut f = fixture();
let f = fixture();
f.module.memberships.lock().unwrap().clear();
let err = f
.module
Expand Down
9 changes: 2 additions & 7 deletions application/src/service/profile_transfer/test_support/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ mod module;
mod profile;
mod request;

pub(super) use account::MockAccountQuery;
pub(super) use database::{MockConnection, MockDatabaseConnection};
pub(super) use module::{fixture, Fixture};
pub(super) use profile::{profile_with_media, MockProfileReadModel, MockProfileRepository};
pub(super) use request::{
active_membership, MockProfileMediaCopyGateway, MockProfileTransferRequestReadModel,
MockProfileTransferRequestRepository,
};
pub(super) use profile::profile_with_media;
pub(super) use request::active_membership;
2 changes: 1 addition & 1 deletion driver/src/database/postgres/profile_transfer_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ mod test {
ProfileTransferRequestReadModel,
};
use kernel::prelude::entity::{
AccountId, AccountKind, EventVersion, Nanoid, ProfileId, ProfileTransferRequest,
AccountKind, EventVersion, Nanoid, ProfileId, ProfileTransferRequest,
ProfileTransferRequestId,
};
use kernel::test_utils::{AccountBuilder, ProfileBuilder};
Expand Down
18 changes: 9 additions & 9 deletions kernel/src/entity/profile_transfer_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,15 @@ impl EventApplier for ProfileTransferRequest {
}
}

fn status_name(status: &ProfileTransferStatus) -> &'static str {
match status {
ProfileTransferStatus::Pending => "pending",
ProfileTransferStatus::Accepted => "accepted",
ProfileTransferStatus::Rejected => "rejected",
ProfileTransferStatus::Cancelled => "cancelled",
}
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down Expand Up @@ -349,12 +358,3 @@ mod tests {
assert_eq!(err.current_context(), &KernelError::Internal);
}
}

fn status_name(status: &ProfileTransferStatus) -> &'static str {
match status {
ProfileTransferStatus::Pending => "pending",
ProfileTransferStatus::Accepted => "accepted",
ProfileTransferStatus::Rejected => "rejected",
ProfileTransferStatus::Cancelled => "cancelled",
}
}
2 changes: 1 addition & 1 deletion server/src/route/report/test_support.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl ReportTestApp {
let target_event = AccountEvent::Created {
name: target.name().clone(),
is_bot: target.is_bot().clone(),
kind: target.kind().clone(),
kind: *target.kind(),
nanoid: target.nanoid().clone(),
auth_account_id: auth_account_id.clone(),
};
Expand Down
Loading