added need_reboot endpoint to admin api
This commit is contained in:
parent
2b57f73b77
commit
72ef6cc4f2
5 changed files with 52 additions and 29 deletions
|
|
@ -2110,7 +2110,7 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
|
|||
|> get("/api/pleroma/admin/config")
|
||||
|> json_response(200)
|
||||
|
||||
refute Map.has_key?(configs, "need_reboot")
|
||||
assert configs["need_reboot"] == false
|
||||
end
|
||||
|
||||
test "update setting which need reboot, don't change reboot flag until reboot", %{conn: conn} do
|
||||
|
|
@ -2166,7 +2166,7 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
|
|||
|> get("/api/pleroma/admin/config")
|
||||
|> json_response(200)
|
||||
|
||||
refute Map.has_key?(configs, "need_reboot")
|
||||
assert configs["need_reboot"] == false
|
||||
end
|
||||
|
||||
test "saving config with nested merge", %{conn: conn} do
|
||||
|
|
@ -2861,6 +2861,20 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
|
|||
end
|
||||
end
|
||||
|
||||
test "need_reboot flag", %{conn: conn} do
|
||||
assert conn
|
||||
|> get("/api/pleroma/admin/need_reboot")
|
||||
|> json_response(200) == %{"need_reboot" => false}
|
||||
|
||||
Restarter.Pleroma.need_reboot()
|
||||
|
||||
assert conn
|
||||
|> get("/api/pleroma/admin/need_reboot")
|
||||
|> json_response(200) == %{"need_reboot" => true}
|
||||
|
||||
on_exit(fn -> Restarter.Pleroma.refresh() end)
|
||||
end
|
||||
|
||||
describe "GET /api/pleroma/admin/statuses" do
|
||||
test "returns all public and unlisted statuses", %{conn: conn, admin: admin} do
|
||||
blocked = insert(:user)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue