Fix tests for CI

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2022-09-21 08:32:42 +02:00
parent 151a7e54ae
commit 6a9fba7db8
20 changed files with 164 additions and 34 deletions

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang={assigns.locale} dir={language_direction(assigns)}>
<html lang={Map.get(assigns, :locale, "en")} dir={language_direction(assigns)}>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

View File

@@ -5,6 +5,7 @@ defmodule Mobilizon.Web.AuthView do
use Mobilizon.Web, :view
alias Mobilizon.Service.Metadata.Instance
alias Mobilizon.Web.PageView
alias Phoenix.HTML.Tag
@spec render(String.t(), map()) :: String.t() | Plug.Conn.t()
@@ -33,7 +34,7 @@ defmodule Mobilizon.Web.AuthView do
with tags <- Instance.build_tags() ++ info_tags,
assigns <- Map.put(assigns, :tags, tags) do
render("index.html", assigns)
PageView.render("index.html", assigns)
end
end
end

View File

@@ -3,10 +3,11 @@ defmodule Mobilizon.Web.ErrorView do
View for errors
"""
use Mobilizon.Web, :view
alias Mobilizon.Web.PageView
@spec render(String.t(), map()) :: map() | String.t() | Plug.Conn.t()
def render("404.html", _assigns) do
render("index.html")
PageView.render("index.html")
end
def render("404.json", _assigns) do

View File

@@ -84,6 +84,6 @@ defmodule Mobilizon.Web.PageView do
end
def language_direction(assigns) do
get_language_direction(assigns.locale)
assigns |> Map.get(:locale, "en") |> get_language_direction()
end
end