-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e0c555
commit 972b860
Showing
2 changed files
with
6 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,9 +43,9 @@ defmodule Moebius.UpdateTest do | |
assert cmd.params == ["test", "[email protected]"] | ||
end | ||
|
||
|
||
test "basic update with 'in' filter" do | ||
names = ["Super", "Mike"] | ||
|
||
cmd = | ||
db(:users) | ||
|> filter(:first, in: names) | ||
|
@@ -56,19 +56,17 @@ defmodule Moebius.UpdateTest do | |
assert cmd.params == names ++ [["newrole"]] | ||
end | ||
|
||
|
||
test "basic update with '>' filter" do | ||
cmd = | ||
db(:users) | ||
|> filter(:order_count, gt: 5) | ||
|> update(roles: ["newrole"]) | ||
|
||
assert cmd.sql == "update users set roles = $2 where order_count > $1 returning *;" | ||
assert length(cmd.params) == 2 | ||
assert cmd.params == [5, ["newrole"]] | ||
end | ||
|
||
|
||
|
||
# TODO: Move this to date tests | ||
|
||
# test "it actually works" do | ||
|