Add actor parameter to all tests requiring authorization

This commit adds actor: system_actor to all Ash operations in tests that
require authorization.
This commit is contained in:
Moritz 2026-01-23 20:00:24 +01:00 committed by Simon
parent 0cedbe52f9
commit c715a45277
Signed by: simon
GPG key ID: 40E7A58C4AA1EDB2
75 changed files with 4686 additions and 2859 deletions

View file

@ -19,6 +19,8 @@ defmodule MvWeb.MemberLive.IndexFieldVisibilityTest do
alias Mv.Membership.{CustomField, CustomFieldValue, Member}
setup do
system_actor = Mv.Helpers.SystemActor.get_system_actor()
# Create test members
{:ok, member1} =
Member
@ -29,7 +31,7 @@ defmodule MvWeb.MemberLive.IndexFieldVisibilityTest do
street: "Main St",
city: "Berlin"
})
|> Ash.create()
|> Ash.create(actor: system_actor)
{:ok, member2} =
Member
@ -40,7 +42,7 @@ defmodule MvWeb.MemberLive.IndexFieldVisibilityTest do
street: "Second St",
city: "Hamburg"
})
|> Ash.create()
|> Ash.create(actor: system_actor)
# Create custom field
{:ok, custom_field} =
@ -50,7 +52,7 @@ defmodule MvWeb.MemberLive.IndexFieldVisibilityTest do
value_type: :string,
show_in_overview: true
})
|> Ash.create()
|> Ash.create(actor: system_actor)
# Create custom field values
{:ok, _cfv1} =
@ -60,7 +62,7 @@ defmodule MvWeb.MemberLive.IndexFieldVisibilityTest do
custom_field_id: custom_field.id,
value: "M001"
})
|> Ash.create()
|> Ash.create(actor: system_actor)
{:ok, _cfv2} =
CustomFieldValue
@ -69,7 +71,7 @@ defmodule MvWeb.MemberLive.IndexFieldVisibilityTest do
custom_field_id: custom_field.id,
value: "M002"
})
|> Ash.create()
|> Ash.create(actor: system_actor)
%{
member1: member1,