diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2019-02-10 23:11:12 +0100 |
---|---|---|
committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2019-02-16 19:52:46 +0100 |
commit | 72a4272d84a68ceb4d9a39ddaa4d3f45779bfebf (patch) | |
tree | df02d847285711b2bb983de11d38ac0369f5d9e7 | |
parent | 4df455f69bef5270c7e6a57022237ff75f13687c (diff) | |
download | pleroma-72a4272d84a68ceb4d9a39ddaa4d3f45779bfebf.tar.gz |
Web.MastodonAPI.MastodonAPIControllerTest: Add testing of the flavour switching
-rw-r--r-- | test/web/mastodon_api/mastodon_api_controller_test.exs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index 26c9c25a6..450bf10a3 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -1786,4 +1786,29 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do |> json_response(200) end end + + test "flavours switching (Pleroma Extension)", %{conn: conn} do + user = insert(:user) + + get_old_flavour = + conn + |> assign(:user, user) + |> get("/api/v1/pleroma/flavour") + + assert "glitch" == json_response(get_old_flavour, 200) + + set_flavour = + conn + |> assign(:user, user) + |> post("/api/v1/pleroma/flavour/vanilla") + + assert "vanilla" == json_response(set_flavour, 200) + + get_new_flavour = + conn + |> assign(:user, user) + |> post("/api/v1/pleroma/flavour/vanilla") + + assert json_response(set_flavour, 200) == json_response(get_new_flavour, 200) + end end |