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:
parent
686f69c9e9
commit
0f48a9b15a
75 changed files with 4686 additions and 2859 deletions
|
|
@ -64,6 +64,8 @@ defmodule MvWeb.UserLive.ShowTest do
|
|||
end
|
||||
|
||||
test "displays linked member when present", %{conn: conn} do
|
||||
system_actor = Mv.Helpers.SystemActor.get_system_actor()
|
||||
|
||||
# Create member
|
||||
{:ok, member} =
|
||||
Member
|
||||
|
|
@ -72,7 +74,7 @@ defmodule MvWeb.UserLive.ShowTest do
|
|||
last_name: "Smith",
|
||||
email: "alice@example.com"
|
||||
})
|
||||
|> Ash.create()
|
||||
|> Ash.create(actor: system_actor)
|
||||
|
||||
# Create user and link to member
|
||||
user = create_test_user(%{email: "user@example.com"})
|
||||
|
|
@ -81,7 +83,7 @@ defmodule MvWeb.UserLive.ShowTest do
|
|||
user
|
||||
|> Ash.Changeset.for_update(:update, %{})
|
||||
|> Ash.Changeset.manage_relationship(:member, member, type: :append_and_remove)
|
||||
|> Ash.update()
|
||||
|> Ash.update(actor: system_actor)
|
||||
|
||||
conn = conn_with_oidc_user(conn)
|
||||
{:ok, _view, html} = live(conn, ~p"/users/#{user.id}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue