summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormarcin mikołajczak <git@mkljczk.pl>2024-04-06 10:54:59 +0200
committermarcin mikołajczak <git@mkljczk.pl>2024-04-06 11:45:19 +0200
commitccc3ac241f5b7c88b36efe60a4f9e5d791d2d49a (patch)
tree8f463989ca84ce2d9af9ff1fb385c35a247404d1 /test
parent01a5f839c58d89be802e162280bd02c577bdec89 (diff)
downloadpleroma-ccc3ac241f5b7c88b36efe60a4f9e5d791d2d49a.tar.gz
pleroma-ccc3ac241f5b7c88b36efe60a4f9e5d791d2d49a.zip
Add hint to rules
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs23
1 files changed, 17 insertions, 6 deletions
diff --git a/test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs
index bfc672ff7..373a84303 100644
--- a/test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs
+++ b/test/pleroma/web/mastodon_api/controllers/instance_controller_test.exs
@@ -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