fix: updated fuzzy search after merge with sorting
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
carla 2025-10-30 17:16:23 +01:00
parent 5e51f99797
commit 3481b9dadf
3 changed files with 31 additions and 1 deletions

View file

@ -161,4 +161,30 @@ defmodule Mv.Membership.FuzzySearchTest do
ids = Enum.map(result, & &1.id)
assert s1.id in ids
end
test "substring in city matches mid-string" do
{:ok, b} =
Mv.Membership.create_member(%{
first_name: "City",
last_name: "One",
email: "city1@example.com",
city: "Berlin"
})
{:ok, _m} =
Mv.Membership.create_member(%{
first_name: "City",
last_name: "Two",
email: "city2@example.com",
city: "München"
})
result =
Mv.Membership.Member
|> Mv.Membership.Member.fuzzy_search(%{query: "erl"})
|> Ash.read!()
ids = Enum.map(result, & &1.id)
assert b.id in ids
end
end