defmodule MvWeb.LocaleTest do
  use MvWeb.ConnCase, async: true
  import Phoenix.ConnTest

  test "language switch via form sets the locale to English in the session" do
    conn = post(build_conn(), "/set_locale", %{"locale" => "en"})
    assert get_session(conn, :locale) == "en"
  end

  test "language switch via form sets the locale to German in the session" do
    conn = post(build_conn(), "/set_locale", %{"locale" => "de"})
    assert get_session(conn, :locale) == "de"
  end
end
