defmodule ToweropsWeb.UserSettingsHTMLTest do
  use ToweropsWeb.ConnCase, async: true

  import Phoenix.Template, only: [render_to_string: 4]

  alias Towerops.Accounts.User

  describe "edit.html" do
    test "renders settings form" do
      email_changeset = User.email_changeset(%User{email: "user@example.com"}, %{})
      password_changeset = User.password_changeset(%User{}, %{})

      html =
        render_to_string(ToweropsWeb.UserSettingsHTML, "edit", "html",
          flash: %{},
          current_scope: nil,
          email_changeset: email_changeset,
          password_changeset: password_changeset,
          mobile_sessions: []
        )

      assert html =~ "Account Settings"
      assert html =~ "Change Email"
      assert html =~ "Save Password"
    end
  end
end
