test: adapt tests for attribute-level default solution
This commit is contained in:
parent
e7bf777be2
commit
8f3fd9d0d7
4 changed files with 37 additions and 20 deletions
|
|
@ -31,7 +31,9 @@ defmodule Mv.DataCase do
|
|||
|
||||
setup tags do
|
||||
Mv.DataCase.setup_sandbox(tags)
|
||||
# Ensure "Mitglied" role exists for AssignDefaultRole to work in tests
|
||||
# Ensure "Mitglied" role exists for default role assignment to work in tests
|
||||
# Note: This runs in every test because each test runs in a sandboxed database.
|
||||
# The check is fast (single query) and idempotent (skips if role exists).
|
||||
Mv.DataCase.ensure_default_role()
|
||||
:ok
|
||||
end
|
||||
|
|
@ -49,7 +51,7 @@ defmodule Mv.DataCase do
|
|||
@doc """
|
||||
Ensures the default "Mitglied" role exists in the test database.
|
||||
|
||||
This is necessary because AssignDefaultRole expects this role to exist.
|
||||
This is necessary because the role_id attribute's default function expects this role to exist.
|
||||
Tests run in sandbox mode, so the role needs to be created for each test.
|
||||
"""
|
||||
def ensure_default_role do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue