Add tests
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
574db5b988
commit
d26aadb743
2 changed files with 39 additions and 0 deletions
|
|
@ -43,4 +43,15 @@ defmodule Pleroma.RuleTest do
|
|||
Rule.query()
|
||||
|> Pleroma.Repo.all()
|
||||
end
|
||||
|
||||
test "getting rules by ids" do
|
||||
%{id: id1} = Rule.create(%{text: "Example rule"})
|
||||
%{id: id2} = Rule.create(%{text: "Second rule"})
|
||||
%{id: _id3} = Rule.create(%{text: "Third rule"})
|
||||
|
||||
rules = Rule.get([id1, id2])
|
||||
|
||||
assert Enum.all?(rules, &(&1.id in [id1, id2]))
|
||||
assert length(rules) == 2
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue