mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 08:36:29 +00:00
Test that we ignore invalid subscription alert types separately.
This commit is contained in:
parent
30f140e570
commit
ff7a4b6aa2
1 changed files with 21 additions and 2 deletions
|
@ -54,6 +54,26 @@ defmodule Pleroma.Web.MastodonAPI.SubscriptionControllerTest do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "ignores unsupported types", %{conn: conn} do
|
||||||
|
result =
|
||||||
|
conn
|
||||||
|
|> post("/api/v1/push/subscription", %{
|
||||||
|
"data" => %{
|
||||||
|
"alerts" => %{
|
||||||
|
"fake_unsupported_type" => true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"subscription" => @sub
|
||||||
|
})
|
||||||
|
|> json_response_and_validate_schema(200)
|
||||||
|
|
||||||
|
refute %{
|
||||||
|
"alerts" => %{
|
||||||
|
"fake_unsupported_type" => true
|
||||||
|
}
|
||||||
|
} == result
|
||||||
|
end
|
||||||
|
|
||||||
test "successful creation", %{conn: conn} do
|
test "successful creation", %{conn: conn} do
|
||||||
result =
|
result =
|
||||||
conn
|
conn
|
||||||
|
@ -65,8 +85,7 @@ defmodule Pleroma.Web.MastodonAPI.SubscriptionControllerTest do
|
||||||
"follow" => true,
|
"follow" => true,
|
||||||
"reblog" => true,
|
"reblog" => true,
|
||||||
"pleroma:chat_mention" => true,
|
"pleroma:chat_mention" => true,
|
||||||
"pleroma:emoji_reaction" => true,
|
"pleroma:emoji_reaction" => true
|
||||||
"test" => true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"subscription" => @sub
|
"subscription" => @sub
|
||||||
|
|
Loading…
Reference in a new issue