Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4e2cf7f

Browse files
adding a basic test
1 parenta095200 commit4e2cf7f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

‎test/filter_test.exs‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,4 +386,27 @@ defmodule AshPostgres.FilterTest do
386386
assert[]=results
387387
end
388388
end
389+
390+
describe"fragments"do
391+
test"double replacement works"do
392+
post=
393+
Post
394+
|>Ash.Changeset.new(%{title:"match",score:4})
395+
|>Api.create!()
396+
397+
Post
398+
|>Ash.Changeset.new(%{title:"non_match",score:2})
399+
|>Api.create!()
400+
401+
assert[%{title:"match"}]=
402+
Post
403+
|>Ash.Query.filter(fragment("? = ?",title,^post.title))
404+
|>Api.read!()
405+
406+
assert[]=
407+
Post
408+
|>Ash.Query.filter(fragment("? = ?",title,"nope"))
409+
|>Api.read!()
410+
end
411+
end
389412
end

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp