fix: updated fuzzy search after merge with sorting
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
5e51f99797
commit
3481b9dadf
3 changed files with 31 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue