feat: remove birth_date field from Member resource
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Users who need birthday data can use custom fields instead. Closes #161
This commit is contained in:
parent
40835f7a2d
commit
c8968636a8
10 changed files with 76 additions and 35 deletions
|
|
@ -6,7 +6,6 @@ defmodule Mv.Membership.MemberTest do
|
|||
@valid_attrs %{
|
||||
first_name: "John",
|
||||
last_name: "Doe",
|
||||
birth_date: ~D[1990-01-01],
|
||||
paid: true,
|
||||
email: "john@example.com",
|
||||
phone_number: "+49123456789",
|
||||
|
|
@ -43,12 +42,6 @@ defmodule Mv.Membership.MemberTest do
|
|||
assert error_message(errors, :email) =~ "is not a valid email"
|
||||
end
|
||||
|
||||
test "Birth date is optional but must not be in the future" do
|
||||
attrs = Map.put(@valid_attrs, :birth_date, Date.utc_today() |> Date.add(1))
|
||||
assert {:error, %Ash.Error.Invalid{errors: errors}} = Membership.create_member(attrs)
|
||||
assert error_message(errors, :birth_date) =~ "cannot be in the future"
|
||||
end
|
||||
|
||||
test "Paid is optional but must be boolean if specified" do
|
||||
attrs = Map.put(@valid_attrs, :paid, nil)
|
||||
attrs2 = Map.put(@valid_attrs, :paid, "yes")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue