aboutsummaryrefslogtreecommitdiff
path: root/test/mix/tasks/pleroma/frontend_test.exs
diff options
context:
space:
mode:
Diffstat (limited to 'test/mix/tasks/pleroma/frontend_test.exs')
-rw-r--r--test/mix/tasks/pleroma/frontend_test.exs25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/mix/tasks/pleroma/frontend_test.exs b/test/mix/tasks/pleroma/frontend_test.exs
index aa4b25ebb..db6a8a4dd 100644
--- a/test/mix/tasks/pleroma/frontend_test.exs
+++ b/test/mix/tasks/pleroma/frontend_test.exs
@@ -82,4 +82,29 @@ defmodule Mix.Tasks.Pleroma.FrontendTest do
assert File.exists?(Path.join([@dir, "frontends", "unknown", "baka", "test.txt"]))
end
+
+ describe "enable" do
+ setup do
+ clear_config(:configurable_from_database, true)
+ end
+
+ test "enabling a primary frontend" do
+ capture_io(fn -> Frontend.run(["enable", "soapbox-fe"]) end)
+
+ primary = Pleroma.Config.get([:frontends, :primary])
+ assert primary["name"] == "soapbox-fe"
+ end
+
+ test "enabling an admin frontend" do
+ capture_io(fn -> Frontend.run(["enable", "soapbox-fe", "--admin"]) end)
+
+ primary = Pleroma.Config.get([:frontends, :admin])
+ assert primary["name"] == "soapbox-fe"
+ end
+
+ test "raise if configurable_from_database is disabled" do
+ clear_config(:configurable_from_database, false)
+ assert_raise(RuntimeError, fn -> Frontend.run(["enable", "soapbox-fe"]) end)
+ end
+ end
end