Add hint to rules
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
01a5f839c5
commit
ccc3ac241f
9 changed files with 50 additions and 15 deletions
|
|
@ -129,16 +129,27 @@ defmodule Pleroma.Web.MastodonAPI.InstanceControllerTest do
|
|||
end
|
||||
|
||||
test "get instance rules", %{conn: conn} do
|
||||
Rule.create(%{text: "Example rule"})
|
||||
Rule.create(%{text: "Second rule"})
|
||||
Rule.create(%{text: "Third rule"})
|
||||
Rule.create(%{text: "Example rule", hint: "Rule description", priority: 1})
|
||||
Rule.create(%{text: "Third rule", priority: 2})
|
||||
Rule.create(%{text: "Second rule", priority: 1})
|
||||
|
||||
conn = get(conn, "/api/v1/instance")
|
||||
|
||||
assert result = json_response_and_validate_schema(conn, 200)
|
||||
|
||||
rules = result["rules"]
|
||||
|
||||
assert length(rules) == 3
|
||||
assert [
|
||||
%{
|
||||
"text" => "Example rule",
|
||||
"hint" => "Rule description"
|
||||
},
|
||||
%{
|
||||
"text" => "Second rule",
|
||||
"hint" => ""
|
||||
},
|
||||
%{
|
||||
"text" => "Third rule",
|
||||
"hint" => ""
|
||||
}
|
||||
] = result["rules"]
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue