feat(seeds): shorten the GDPR field to "DSGVO" and seed its join_description
This commit is contained in:
parent
404d524ee1
commit
1f52350562
3 changed files with 66 additions and 16 deletions
|
|
@ -123,5 +123,24 @@ defmodule Mv.SeedsTest do
|
|||
assert mitglied.permission_set_name == "own_data",
|
||||
"Mitglied role must have own_data permission set"
|
||||
end
|
||||
|
||||
test "bootstrap seeds create the DSGVO custom field and not the old long name", %{
|
||||
actor: actor
|
||||
} do
|
||||
{:ok, custom_fields} = Ash.read(Mv.Membership.CustomField, actor: actor)
|
||||
names = Enum.map(custom_fields, & &1.name)
|
||||
|
||||
assert "DSGVO" in names, "Bootstrap seeds must create a custom field named DSGVO"
|
||||
|
||||
refute "Datenschutzerklärung akzeptiert" in names,
|
||||
"Old long field name must no longer be seeded"
|
||||
|
||||
dsgvo = Enum.find(custom_fields, &(&1.name == "DSGVO"))
|
||||
assert dsgvo.value_type == :boolean
|
||||
|
||||
assert dsgvo.join_description ==
|
||||
"Ich habe die [Datenschutzerklärung](https://example.org/datenschutz) gelesen und akzeptiere sie.",
|
||||
"DSGVO field must be seeded with a default join_description"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue