summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHaelwenn <contact+git.pleroma.social@hacktivis.me>2020-11-12 08:50:26 +0000
committerHaelwenn <contact+git.pleroma.social@hacktivis.me>2020-11-12 08:50:26 +0000
commit99bc175f0257fb0cb9275cba94df662ed219eacf (patch)
tree2068e9446378b0ed604b6489db4fed1188b693ef /test
parentccec59047b314786d2fe9d6a03197019cc4dd7a1 (diff)
parentb0e4e0cf2a151900d29da56424f596f3defa23e3 (diff)
downloadpleroma-99bc175f0257fb0cb9275cba94df662ed219eacf.tar.gz
pleroma-99bc175f0257fb0cb9275cba94df662ed219eacf.zip
Merge branch 'title-injection-change' into 'develop'
Title injection change See merge request pleroma/pleroma!3132
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/fallback_test.exs16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/pleroma/web/fallback_test.exs b/test/pleroma/web/fallback_test.exs
index a65865860..46c7bad1c 100644
--- a/test/pleroma/web/fallback_test.exs
+++ b/test/pleroma/web/fallback_test.exs
@@ -20,15 +20,26 @@ defmodule Pleroma.Web.FallbackTest do
end
end
+ test "GET /*path adds a title", %{conn: conn} do
+ clear_config([:instance, :name], "a cool title")
+
+ assert conn
+ |> get("/")
+ |> html_response(200) =~ "<title>a cool title</title>"
+ end
+
describe "preloaded data and metadata attached to" do
test "GET /:maybe_nickname_or_id", %{conn: conn} do
+ clear_config([:instance, :name], "a cool title")
+
user = insert(:user)
user_missing = get(conn, "/foo")
user_present = get(conn, "/#{user.nickname}")
- assert(html_response(user_missing, 200) =~ "<!--server-generated-meta-->")
+ assert html_response(user_missing, 200) =~ "<!--server-generated-meta-->"
refute html_response(user_present, 200) =~ "<!--server-generated-meta-->"
assert html_response(user_present, 200) =~ "initial-results"
+ assert html_response(user_present, 200) =~ "<title>a cool title</title>"
end
test "GET /*path", %{conn: conn} do
@@ -44,10 +55,13 @@ defmodule Pleroma.Web.FallbackTest do
describe "preloaded data is attached to" do
test "GET /main/public", %{conn: conn} do
+ clear_config([:instance, :name], "a cool title")
+
public_page = get(conn, "/main/public")
refute html_response(public_page, 200) =~ "<!--server-generated-meta-->"
assert html_response(public_page, 200) =~ "initial-results"
+ assert html_response(public_page, 200) =~ "<title>a cool title</title>"
end
test "GET /main/all", %{conn: conn} do