diff --git a/config/test.exs b/config/test.exs index 10c095bf..b9c47a06 100644 --- a/config/test.exs +++ b/config/test.exs @@ -30,4 +30,6 @@ end config :pow, :extension_test_modules, extension_test_modules -config :phoenix_live_view, debug_heex_annotations: true +config :phoenix_live_view, + debug_heex_annotations: true, + debug_attributes: true diff --git a/mix.exs b/mix.exs index 5e922c3a..b05df089 100644 --- a/mix.exs +++ b/mix.exs @@ -10,7 +10,7 @@ defmodule Pow.MixProject do elixir: "~> 1.14", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod, - compilers: Mix.compilers(), + compilers: [:phoenix_live_view] ++ Mix.compilers(), deps: deps(), xref: [exclude: [:mnesia]], @@ -34,10 +34,10 @@ defmodule Pow.MixProject do defp deps do [ {:ecto, "~> 2.2 or ~> 3.0"}, - {:phoenix, ">= 1.3.0 and < 1.8.0"}, + {:phoenix, "~> 1.8"}, {:phoenix_html, ">= 2.0.0 and < 5.0.0"}, {:plug, ">= 1.5.0 and < 2.0.0", optional: true}, - {:phoenix_live_view, ">= 0.18.0", optional: true}, + {:phoenix_live_view, "~> 1.1"}, {:phoenix_ecto, "~> 4.3", only: [:dev, :test]}, {:credo, "~> 1.5", only: [:dev, :test]}, @@ -47,7 +47,7 @@ defmodule Pow.MixProject do {:ecto_sql, "~> 3.5", only: [:test]}, {:postgrex, "~> 0.15", only: [:test]}, - {:floki, ">= 0.30.0", only: :test} + {:lazy_html, ">= 0.0.0", only: :test}, ] end diff --git a/mix.lock b/mix.lock index 439c413e..0b178403 100644 --- a/mix.lock +++ b/mix.lock @@ -1,30 +1,34 @@ %{ "bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"}, - "castore": {:hex, :castore, "1.0.11", "4bbd584741601eb658007339ea730b082cc61f3554cf2e8f39bf693a11b49073", [:mix], [], "hexpm", "e03990b4db988df56262852f20de0f659871c35154691427a5047f4967a16a62"}, - "credo": {:hex, :credo, "1.7.11", "d3e805f7ddf6c9c854fd36f089649d7cf6ba74c42bc3795d587814e3c9847102", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "56826b4306843253a66e47ae45e98e7d284ee1f95d53d1612bb483f88a8cf219"}, - "db_connection": {:hex, :db_connection, "2.7.0", "b99faa9291bb09892c7da373bb82cba59aefa9b36300f6145c5f201c7adf48ec", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "dcf08f31b2701f857dfc787fbad78223d61a32204f217f15e881dd93e4bdd3ff"}, + "castore": {:hex, :castore, "1.0.15", "8aa930c890fe18b6fe0a0cff27b27d0d4d231867897bd23ea772dee561f032a3", [:mix], [], "hexpm", "96ce4c69d7d5d7a0761420ef743e2f4096253931a3ba69e5ff8ef1844fe446d3"}, + "cc_precompiler": {:hex, :cc_precompiler, "0.1.11", "8c844d0b9fb98a3edea067f94f616b3f6b29b959b6b3bf25fee94ffe34364768", [:mix], [{:elixir_make, "~> 0.7", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "3427232caf0835f94680e5bcf082408a70b48ad68a5f5c0b02a3bea9f3a075b9"}, + "credo": {:hex, :credo, "1.7.12", "9e3c20463de4b5f3f23721527fcaf16722ec815e70ff6c60b86412c695d426c1", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "8493d45c656c5427d9c729235b99d498bd133421f3e0a683e5c1b561471291e5"}, + "db_connection": {:hex, :db_connection, "2.8.0", "64fd82cfa6d8e25ec6660cea73e92a4cbc6a18b31343910427b702838c4b33b2", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "008399dae5eee1bf5caa6e86d204dcb44242c82b1ed5e22c881f2c34da201b15"}, "decimal": {:hex, :decimal, "2.3.0", "3ad6255aa77b4a3c4f818171b12d237500e63525c2fd056699967a3e7ea20f62", [:mix], [], "hexpm", "a4d66355cb29cb47c3cf30e71329e58361cfcb37c34235ef3bf1d7bf3773aeac"}, - "earmark_parser": {:hex, :earmark_parser, "1.4.42", "f23d856f41919f17cd06a493923a722d87a2d684f143a1e663c04a2b93100682", [:mix], [], "hexpm", "6915b6ca369b5f7346636a2f41c6a6d78b5af419d61a611079189233358b8b8b"}, - "ecto": {:hex, :ecto, "3.12.5", "4a312960ce612e17337e7cefcf9be45b95a3be6b36b6f94dfb3d8c361d631866", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "6eb18e80bef8bb57e17f5a7f068a1719fbda384d40fc37acb8eb8aeca493b6ea"}, - "ecto_sql": {:hex, :ecto_sql, "3.12.1", "c0d0d60e85d9ff4631f12bafa454bc392ce8b9ec83531a412c12a0d415a3a4d0", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.12", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.7", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.19 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "aff5b958a899762c5f09028c847569f7dfb9cc9d63bdb8133bff8a5546de6bf5"}, - "ex_doc": {:hex, :ex_doc, "0.36.1", "4197d034f93e0b89ec79fac56e226107824adcce8d2dd0a26f5ed3a95efc36b1", [:mix], [{:earmark_parser, "~> 1.4.42", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "d7d26a7cf965dacadcd48f9fa7b5953d7d0cfa3b44fa7a65514427da44eafd89"}, + "earmark_parser": {:hex, :earmark_parser, "1.4.44", "f20830dd6b5c77afe2b063777ddbbff09f9759396500cdbe7523efd58d7a339c", [:mix], [], "hexpm", "4778ac752b4701a5599215f7030989c989ffdc4f6df457c5f36938cc2d2a2750"}, + "ecto": {:hex, :ecto, "3.13.2", "7d0c0863f3fc8d71d17fc3ad3b9424beae13f02712ad84191a826c7169484f01", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "669d9291370513ff56e7b7e7081b7af3283d02e046cf3d403053c557894a0b3e"}, + "ecto_sql": {:hex, :ecto_sql, "3.13.2", "a07d2461d84107b3d037097c822ffdd36ed69d1cf7c0f70e12a3d1decf04e2e1", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.13.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.7", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.19 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "539274ab0ecf1a0078a6a72ef3465629e4d6018a3028095dc90f60a19c371717"}, + "elixir_make": {:hex, :elixir_make, "0.9.0", "6484b3cd8c0cee58f09f05ecaf1a140a8c97670671a6a0e7ab4dc326c3109726", [:mix], [], "hexpm", "db23d4fd8b757462ad02f8aa73431a426fe6671c80b200d9710caf3d1dd0ffdb"}, + "ex_doc": {:hex, :ex_doc, "0.38.3", "ddafe36b8e9fe101c093620879f6604f6254861a95133022101c08e75e6c759a", [:mix], [{:earmark_parser, "~> 1.4.44", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "ecaa785456a67f63b4e7d7f200e8832fa108279e7eb73fd9928e7e66215a01f9"}, "file_system": {:hex, :file_system, "1.1.0", "08d232062284546c6c34426997dd7ef6ec9f8bbd090eb91780283c9016840e8f", [:mix], [], "hexpm", "bfcf81244f416871f2a2e15c1b515287faa5db9c6bcf290222206d120b3d43f6"}, + "fine": {:hex, :fine, "0.1.4", "b19a89c1476c7c57afb5f9314aed5960b5bc95d5277de4cb5ee8e1d1616ce379", [:mix], [], "hexpm", "be3324cc454a42d80951cf6023b9954e9ff27c6daa255483b3e8d608670303f5"}, "floki": {:hex, :floki, "0.37.0", "b83e0280bbc6372f2a403b2848013650b16640cd2470aea6701f0632223d719e", [:mix], [], "hexpm", "516a0c15a69f78c47dc8e0b9b3724b29608aa6619379f91b1ffa47109b5d0dd3"}, "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"}, + "lazy_html": {:hex, :lazy_html, "0.1.7", "53aa9ebdbde8aec7c8ee03a8bdaec38dd56302995b0baeebf8dbe7cbdd550400", [:make, :mix], [{:cc_precompiler, "~> 0.1", [hex: :cc_precompiler, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.9.0", [hex: :elixir_make, repo: "hexpm", optional: false]}, {:fine, "~> 0.1.0", [hex: :fine, repo: "hexpm", optional: false]}], "hexpm", "e115944e6ddb887c45cadfd660348934c318abec0341f7b7156e912b98d3eb95"}, "makeup": {:hex, :makeup, "1.2.1", "e90ac1c65589ef354378def3ba19d401e739ee7ee06fb47f94c687016e3713d1", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "d36484867b0bae0fea568d10131197a4c2e47056a6fbe84922bf6ba71c8d17ce"}, "makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"}, - "makeup_erlang": {:hex, :makeup_erlang, "1.0.1", "c7f58c120b2b5aa5fd80d540a89fdf866ed42f1f3994e4fe189abebeab610839", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "8a89a1eeccc2d798d6ea15496a6e4870b75e014d1af514b1b71fa33134f57814"}, - "mime": {:hex, :mime, "2.0.6", "8f18486773d9b15f95f4f4f1e39b710045fa1de891fada4516559967276e4dc2", [:mix], [], "hexpm", "c9945363a6b26d747389aac3643f8e0e09d30499a138ad64fe8fd1d13d9b153e"}, - "nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"}, - "phoenix": {:hex, :phoenix, "1.7.18", "5310c21443514be44ed93c422e15870aef254cf1b3619e4f91538e7529d2b2e4", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.7", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "1797fcc82108442a66f2c77a643a62980f342bfeb63d6c9a515ab8294870004e"}, - "phoenix_ecto": {:hex, :phoenix_ecto, "4.6.3", "f686701b0499a07f2e3b122d84d52ff8a31f5def386e03706c916f6feddf69ef", [:mix], [{:ecto, "~> 3.5", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.1", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}], "hexpm", "909502956916a657a197f94cc1206d9a65247538de8a5e186f7537c895d95764"}, - "phoenix_html": {:hex, :phoenix_html, "4.2.0", "83a4d351b66f472ebcce242e4ae48af1b781866f00ef0eb34c15030d4e2069ac", [:mix], [], "hexpm", "9713b3f238d07043583a94296cc4bbdceacd3b3a6c74667f4df13971e7866ec8"}, - "phoenix_live_view": {:hex, :phoenix_live_view, "1.0.2", "e7b1dd68c86326e2c45cc81da41e332cc8aa7228a7161e2c811dcd7f1dd14db1", [:mix], [{:floki, "~> 0.36", [hex: :floki, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.15 or ~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.3 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.15", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "8a40265b0cd7d3a35f136dfa3cc048e3b198fc3718763411a78c323a44ebebee"}, + "makeup_erlang": {:hex, :makeup_erlang, "1.0.2", "03e1804074b3aa64d5fad7aa64601ed0fb395337b982d9bcf04029d68d51b6a7", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "af33ff7ef368d5893e4a267933e7744e46ce3cf1f61e2dccf53a111ed3aa3727"}, + "mime": {:hex, :mime, "2.0.7", "b8d739037be7cd402aee1ba0306edfdef982687ee7e9859bee6198c1e7e2f128", [:mix], [], "hexpm", "6171188e399ee16023ffc5b76ce445eb6d9672e2e241d2df6050f3c771e80ccd"}, + "nimble_parsec": {:hex, :nimble_parsec, "1.4.2", "8efba0122db06df95bfaa78f791344a89352ba04baedd3849593bfce4d0dc1c6", [:mix], [], "hexpm", "4b21398942dda052b403bbe1da991ccd03a053668d147d53fb8c4e0efe09c973"}, + "phoenix": {:hex, :phoenix, "1.8.1", "865473a60a979551a4879db79fbfb4503e41cd809e77c85af79716578b6a456d", [:mix], [{:bandit, "~> 1.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.7", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "84d77d2b2e77c3c7e7527099bd01ef5c8560cd149c036d6b3a40745f11cd2fb2"}, + "phoenix_ecto": {:hex, :phoenix_ecto, "4.6.5", "c4ef322acd15a574a8b1a08eff0ee0a85e73096b53ce1403b6563709f15e1cea", [:mix], [{:ecto, "~> 3.5", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.1", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.16 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}], "hexpm", "26ec3208eef407f31b748cadd044045c6fd485fbff168e35963d2f9dfff28d4b"}, + "phoenix_html": {:hex, :phoenix_html, "4.2.1", "35279e2a39140068fc03f8874408d58eef734e488fc142153f055c5454fd1c08", [:mix], [], "hexpm", "cff108100ae2715dd959ae8f2a8cef8e20b593f8dfd031c9cba92702cf23e053"}, + "phoenix_live_view": {:hex, :phoenix_live_view, "1.1.11", "1b4d8fa56898d93b6f528c89227198a3fce7c5b242819b22ed9e92b73c1bb077", [:mix], [{:igniter, ">= 0.6.16 and < 1.0.0-0", [hex: :igniter, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:lazy_html, "~> 0.1.0", [hex: :lazy_html, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.15 or ~> 1.7.0 or ~> 1.8.0-rc", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.3 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.15", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "266823602e11a54e562ac03a25b3d232d79de12514262db7cfcbb83fdfd8fd57"}, "phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.3", "3168d78ba41835aecad272d5e8cd51aa87a7ac9eb836eabc42f6e57538e3731d", [:mix], [], "hexpm", "bba06bc1dcfd8cb086759f0edc94a8ba2bc8896d5331a1e2c2902bf8e36ee502"}, "phoenix_template": {:hex, :phoenix_template, "1.0.4", "e2092c132f3b5e5b2d49c96695342eb36d0ed514c5b252a77048d5969330d639", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "2c0c81f0e5c6753faf5cca2f229c9709919aba34fab866d3bc05060c9c444206"}, - "plug": {:hex, :plug, "1.16.1", "40c74619c12f82736d2214557dedec2e9762029b2438d6d175c5074c933edc9d", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a13ff6b9006b03d7e33874945b2755253841b238c34071ed85b0e86057f8cddc"}, - "plug_crypto": {:hex, :plug_crypto, "2.1.0", "f44309c2b06d249c27c8d3f65cfe08158ade08418cf540fd4f72d4d6863abb7b", [:mix], [], "hexpm", "131216a4b030b8f8ce0f26038bc4421ae60e4bb95c5cf5395e1421437824c4fa"}, - "postgrex": {:hex, :postgrex, "0.19.3", "a0bda6e3bc75ec07fca5b0a89bffd242ca209a4822a9533e7d3e84ee80707e19", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "d31c28053655b78f47f948c85bb1cf86a9c1f8ead346ba1aa0d0df017fa05b61"}, + "plug": {:hex, :plug, "1.18.1", "5067f26f7745b7e31bc3368bc1a2b818b9779faa959b49c934c17730efc911cf", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "57a57db70df2b422b564437d2d33cf8d33cd16339c1edb190cd11b1a3a546cc2"}, + "plug_crypto": {:hex, :plug_crypto, "2.1.1", "19bda8184399cb24afa10be734f84a16ea0a2bc65054e23a62bb10f06bc89491", [:mix], [], "hexpm", "6470bce6ffe41c8bd497612ffde1a7e4af67f36a15eea5f921af71cf3e11247c"}, + "postgrex": {:hex, :postgrex, "0.21.1", "2c5cc830ec11e7a0067dd4d623c049b3ef807e9507a424985b8dcf921224cd88", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "27d8d21c103c3cc68851b533ff99eef353e6a0ff98dc444ea751de43eb48bdac"}, "telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"}, "websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"}, "websock_adapter": {:hex, :websock_adapter, "0.5.8", "3b97dc94e407e2d1fc666b2fb9acf6be81a1798a2602294aac000260a7c4a47d", [:mix], [{:bandit, ">= 0.6.0", [hex: :bandit, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.6", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "315b9a1865552212b5f35140ad194e67ce31af45bcee443d4ecb96b5fd3f3782"}, diff --git a/test/extensions/email_confirmation/ecto/schema_test.exs b/test/extensions/email_confirmation/ecto/schema_test.exs index 0ab38772..0b79fabd 100644 --- a/test/extensions/email_confirmation/ecto/schema_test.exs +++ b/test/extensions/email_confirmation/ecto/schema_test.exs @@ -15,7 +15,7 @@ defmodule PowEmailConfirmation.Ecto.SchemaTest do use Pow.Extension.Ecto.Schema, extensions: [PowEmailConfirmation] - @ecto_derive_inspect_for_redacted_fields false + @derive_inspect_for_redacted_fields false schema "users" do pow_user_fields() diff --git a/test/extensions/email_confirmation/phoenix/controllers/controller_callbacks_test.exs b/test/extensions/email_confirmation/phoenix/controllers/controller_callbacks_test.exs index 8989a903..85de5f6c 100644 --- a/test/extensions/email_confirmation/phoenix/controllers/controller_callbacks_test.exs +++ b/test/extensions/email_confirmation/phoenix/controllers/controller_callbacks_test.exs @@ -74,13 +74,13 @@ defmodule PowEmailConfirmation.Phoenix.ControllerCallbacksTest do assert html = html_response(conn, 200) - html_tree = DOM.parse(html) + {html_tree, _} = DOM.parse_document(html) - assert [_input_elem] = DOM.all(html_tree, "input[name=\"user[email]\"]") - assert DOM.all(html_tree, "*[phx-feedback-for=\"user[email]\"] > p") == [] + assert _input_elem = DOM.all(html_tree, "input[name=\"user[email]\"]") + assert Enum.empty?(DOM.all(html_tree, "*[phx-feedback-for=\"user[email]\"] > p")) - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[password_confirmation]\"]") - assert [error_elem] = DOM.all(html_tree, "*[phx-feedback-for=\"user[password_confirmation]\"] > p") + assert input_elem = DOM.all(html_tree, "input[name=\"user[password_confirmation]\"]") + assert error_elem = DOM.all(html_tree, "*[phx-feedback-for=\"user[password_confirmation]\"] > p") assert DOM.attribute(input_elem, "value") == "invalid" assert DOM.to_text(error_elem) =~ "does not match confirmation" end @@ -105,10 +105,10 @@ defmodule PowEmailConfirmation.Phoenix.ControllerCallbacksTest do assert html = html_response(conn, 200) - html_tree = DOM.parse(html) + {html_tree, _} = DOM.parse_document(html) - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[email]\"]") - assert [error_elem] = DOM.all(html_tree, "*[phx-feedback-for=\"user[email]\"] > p") + assert input_elem = DOM.all(html_tree, "input[name=\"user[email]\"]") + assert error_elem = DOM.all(html_tree, "*[phx-feedback-for=\"user[email]\"] > p") assert DOM.attribute(input_elem, "value") == "taken@example.com" assert DOM.to_text(error_elem) =~ "has already been taken" end diff --git a/test/extensions/invitation/ecto/schema_test.exs b/test/extensions/invitation/ecto/schema_test.exs index b6aeebef..126db660 100644 --- a/test/extensions/invitation/ecto/schema_test.exs +++ b/test/extensions/invitation/ecto/schema_test.exs @@ -13,7 +13,7 @@ defmodule PowInvitation.Ecto.SchemaTest do use Pow.Extension.Ecto.Schema, extensions: [PowInvitation] - @ecto_derive_inspect_for_redacted_fields false + @derive_inspect_for_redacted_fields false schema "users" do field :organization_id, :integer diff --git a/test/extensions/invitation/phoenix/controllers/invitation_controller_test.exs b/test/extensions/invitation/phoenix/controllers/invitation_controller_test.exs index 56733710..bd0db382 100644 --- a/test/extensions/invitation/phoenix/controllers/invitation_controller_test.exs +++ b/test/extensions/invitation/phoenix/controllers/invitation_controller_test.exs @@ -25,10 +25,10 @@ defmodule PowInvitation.Phoenix.InvitationControllerTest do assert html = html_response(conn, 200) - html_tree = DOM.parse(html) + {html_tree, _} = DOM.parse_document(html) - assert [label_elem] = DOM.all(html_tree, "label[for=user_email]") - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[email]\"]") + assert label_elem = DOM.all(html_tree, "label[for=user_email]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[email]\"]") assert DOM.to_text(label_elem) =~ "Email" assert DOM.attribute(input_elem, "type") == "email" refute DOM.attribute(input_elem, "value") @@ -44,10 +44,10 @@ defmodule PowInvitation.Phoenix.InvitationControllerTest do assert html = html_response(conn, 200) - html_tree = DOM.parse(html) + {html_tree, _} = DOM.parse_document(html) - assert [label_elem] = DOM.all(html_tree, "label[for=user_username]") - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[username]\"]") + assert label_elem = DOM.all(html_tree, "label[for=user_username]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[username]\"]") assert DOM.to_text(label_elem) =~ "Username" assert DOM.attribute(input_elem, "type") == "text" end @@ -91,10 +91,10 @@ defmodule PowInvitation.Phoenix.InvitationControllerTest do assert html = html_response(conn, 200) - html_tree = DOM.parse(html) + {html_tree, _} = DOM.parse_document(html) - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[email]\"]") - assert [error_elem] = DOM.all(html_tree, "*[phx-feedback-for=\"user[email]\"] > p") + assert input_elem = DOM.all(html_tree, "input[name=\"user[email]\"]") + assert error_elem = DOM.all(html_tree, "*[phx-feedback-for=\"user[email]\"] > p") assert DOM.attribute(input_elem, "value") == "invalid" assert DOM.to_text(error_elem) =~ "has invalid format" end @@ -120,10 +120,10 @@ defmodule PowInvitation.Phoenix.InvitationControllerTest do assert html = html_response(conn, 200) - html_tree = DOM.parse(html) + {html_tree, _} = DOM.parse_document(html) - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[email]\"]") - assert [error_elem] = DOM.all(html_tree, "*[phx-feedback-for=\"user[email]\"] > p") + assert input_elem = DOM.all(html_tree, "input[name=\"user[email]\"]") + assert error_elem = DOM.all(html_tree, "*[phx-feedback-for=\"user[email]\"] > p") assert DOM.attribute(input_elem, "value") == "taken@example.com" assert DOM.to_text(error_elem) =~ "has already been taken" end @@ -189,22 +189,22 @@ defmodule PowInvitation.Phoenix.InvitationControllerTest do assert html = html_response(conn, 200) - html_tree = DOM.parse(html) + {html_tree, _} = DOM.parse_document(html) - assert [label_elem] = DOM.all(html_tree, "label[for=user_email]") - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[email]\"]") + assert label_elem = DOM.all(html_tree, "label[for=user_email]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[email]\"]") assert DOM.to_text(label_elem) =~ "Email" assert DOM.attribute(input_elem, "type") == "email" assert DOM.attribute(input_elem, "required") - assert [label_elem] = DOM.all(html_tree, "label[for=user_password]") - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[password]\"]") + assert label_elem = DOM.all(html_tree, "label[for=user_password]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[password]\"]") assert DOM.to_text(label_elem) =~ "Password" assert DOM.attribute(input_elem, "type") == "password" assert DOM.attribute(input_elem, "required") - assert [label_elem] = DOM.all(html_tree, "label[for=user_password_confirmation]") - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[password_confirmation]\"]") + assert label_elem = DOM.all(html_tree, "label[for=user_password_confirmation]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[password_confirmation]\"]") assert DOM.to_text(label_elem) =~ "Confirm password" assert DOM.attribute(input_elem, "type") == "password" assert DOM.attribute(input_elem, "required") @@ -253,10 +253,10 @@ defmodule PowInvitation.Phoenix.InvitationControllerTest do assert html = html_response(conn, 200) - html_tree = DOM.parse(html) + {html_tree, _} = DOM.parse_document(html) - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[email]\"]") - assert [error_elem] = DOM.all(html_tree, "*[phx-feedback-for=\"user[email]\"] > p") + assert input_elem = DOM.all(html_tree, "input[name=\"user[email]\"]") + assert error_elem = DOM.all(html_tree, "*[phx-feedback-for=\"user[email]\"] > p") assert DOM.attribute(input_elem, "value") == "taken@example.com" assert DOM.to_text(error_elem) =~ "has already been taken" end @@ -266,15 +266,15 @@ defmodule PowInvitation.Phoenix.InvitationControllerTest do assert html = html_response(conn, 200) - html_tree = DOM.parse(html) + {html_tree, _} = DOM.parse_document(html) - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[email]\"]") - assert [error_elem] = DOM.all(html_tree, "*[phx-feedback-for=\"user[email]\"] > p") + assert input_elem = DOM.all(html_tree, "input[name=\"user[email]\"]") + assert error_elem = DOM.all(html_tree, "*[phx-feedback-for=\"user[email]\"] > p") assert DOM.attribute(input_elem, "value") == "invalid" assert DOM.to_text(error_elem) =~ "has invalid format" - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[password_confirmation]\"]") - assert [error_elem] = DOM.all(html_tree, "*[phx-feedback-for=\"user[password_confirmation]\"] > p") + assert input_elem = DOM.all(html_tree, "input[name=\"user[password_confirmation]\"]") + assert error_elem = DOM.all(html_tree, "*[phx-feedback-for=\"user[password_confirmation]\"] > p") assert DOM.attribute(input_elem, "value") == "invalid" assert DOM.to_text(error_elem) =~ "does not match confirmation" diff --git a/test/extensions/reset_password/ecto/schema_test.exs b/test/extensions/reset_password/ecto/schema_test.exs index 94c95b35..39f579c7 100644 --- a/test/extensions/reset_password/ecto/schema_test.exs +++ b/test/extensions/reset_password/ecto/schema_test.exs @@ -12,7 +12,7 @@ defmodule PowResetPassword.Ecto.SchemaTest do use Pow.Extension.Ecto.Schema, extensions: [PowResetPassword] - @ecto_derive_inspect_for_redacted_fields false + @derive_inspect_for_redacted_fields false schema "users" do field :password_reset_at, :utc_datetime diff --git a/test/extensions/reset_password/phoenix/controllers/reset_password_controller_test.exs b/test/extensions/reset_password/phoenix/controllers/reset_password_controller_test.exs index ea8a6f5b..75d44154 100644 --- a/test/extensions/reset_password/phoenix/controllers/reset_password_controller_test.exs +++ b/test/extensions/reset_password/phoenix/controllers/reset_password_controller_test.exs @@ -16,10 +16,10 @@ defmodule PowResetPassword.Phoenix.ResetPasswordControllerTest do assert html = html_response(conn, 200) - html_tree = DOM.parse(html) + {html_tree, _} = DOM.parse_document(html) - assert [label_elem] = DOM.all(html_tree, "label[for=user_email]") - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[email]\"]") + assert label_elem = DOM.all(html_tree, "label[for=user_email]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[email]\"]") assert DOM.to_text(label_elem) =~ "Email" assert DOM.attribute(input_elem, "type") == "email" refute DOM.attribute(input_elem, "value") @@ -79,9 +79,9 @@ defmodule PowResetPassword.Phoenix.ResetPasswordControllerTest do assert html = html_response(conn, 200) assert get_flash(conn, :error) == "No account exists for the provided email. Please try again." - html_tree = DOM.parse(html) + {html_tree, _} = DOM.parse_document(html) - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[email]\"]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[email]\"]") assert DOM.attribute(input_elem, "value") == "invalid@example.com" end end @@ -122,21 +122,21 @@ defmodule PowResetPassword.Phoenix.ResetPasswordControllerTest do assert html = html_response(conn, 200) - html_tree = DOM.parse(html) + {html_tree, _} = DOM.parse_document(html) - assert [label_elem] = DOM.all(html_tree, "label[for=user_password]") - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[password]\"]") + assert label_elem = DOM.all(html_tree, "label[for=user_password]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[password]\"]") assert DOM.to_text(label_elem) =~ "New password" assert DOM.attribute(input_elem, "type") == "password" assert DOM.attribute(input_elem, "required") - assert [label_elem] = DOM.all(html_tree, "label[for=user_password_confirmation]") - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[password_confirmation]\"]") + assert label_elem = DOM.all(html_tree, "label[for=user_password_confirmation]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[password_confirmation]\"]") assert DOM.to_text(label_elem) =~ "Confirm new password" assert DOM.attribute(input_elem, "type") == "password" assert DOM.attribute(input_elem, "required") - assert [_] = DOM.all(html, "a[href=\"/session/new\"]") + assert _ = DOM.all(html_tree, "a[href=\"/session/new\"]") end end @@ -188,13 +188,13 @@ defmodule PowResetPassword.Phoenix.ResetPasswordControllerTest do assert html = html_response(conn, 200) - html_tree = DOM.parse(html) + {html_tree, _} = DOM.parse_document(html) - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[password]\"]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[password]\"]") assert DOM.attribute(input_elem, "value") == @password - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[password_confirmation]\"]") - assert [error_elem] = DOM.all(html_tree, "*[phx-feedback-for=\"user[password_confirmation]\"] > p") + assert input_elem = DOM.all(html_tree, "input[name=\"user[password_confirmation]\"]") + assert error_elem = DOM.all(html_tree, "*[phx-feedback-for=\"user[password_confirmation]\"] > p") assert DOM.attribute(input_elem, "value") == "invalid" assert DOM.to_text(error_elem) =~ "does not match confirmation" diff --git a/test/pow/ecto/context_test.exs b/test/pow/ecto/context_test.exs index 55d1e352..f501a497 100644 --- a/test/pow/ecto/context_test.exs +++ b/test/pow/ecto/context_test.exs @@ -7,7 +7,7 @@ defmodule Pow.Ecto.ContextTest do use Ecto.Schema use Pow.Ecto.Schema, password_hash_verify: {&__MODULE__.send_hash_password/1, &__MODULE__.send_verify_password/2} - @ecto_derive_inspect_for_redacted_fields false + @derive_inspect_for_redacted_fields false alias Pow.Ecto.Schema.Password diff --git a/test/pow/ecto/schema/changeset_test.exs b/test/pow/ecto/schema/changeset_test.exs index cf7f3afb..4342aad7 100644 --- a/test/pow/ecto/schema/changeset_test.exs +++ b/test/pow/ecto/schema/changeset_test.exs @@ -424,7 +424,7 @@ defmodule Pow.Ecto.Schema.ChangesetTest do use Ecto.Schema use Pow.Ecto.Schema - @ecto_derive_inspect_for_redacted_fields false + @derive_inspect_for_redacted_fields false schema "users" do pow_user_fields() diff --git a/test/pow/ecto/schema_test.exs b/test/pow/ecto/schema_test.exs index 07aaa604..6b03f229 100644 --- a/test/pow/ecto/schema_test.exs +++ b/test/pow/ecto/schema_test.exs @@ -26,7 +26,7 @@ defmodule Pow.Ecto.SchemaTest do use Ecto.Schema use Pow.Ecto.Schema - @ecto_derive_inspect_for_redacted_fields false + @derive_inspect_for_redacted_fields false schema "users" do field :password_hash, :string, source: :encrypted_password @@ -49,7 +49,7 @@ defmodule Pow.Ecto.SchemaTest do use Ecto.Schema use Pow.Ecto.Schema - @ecto_derive_inspect_for_redacted_fields false + @derive_inspect_for_redacted_fields false @pow_assocs {:has_many, :users, __MODULE__, []} @@ -159,7 +159,7 @@ defmodule Pow.Ecto.SchemaTest do use Ecto.Schema use Pow.Ecto.Schema - @ecto_derive_inspect_for_redacted_fields false + @derive_inspect_for_redacted_fields false schema "users" do field :email, CustomType diff --git a/test/pow/extension/ecto/schema_test.exs b/test/pow/extension/ecto/schema_test.exs index 2b8d803f..5acab890 100644 --- a/test/pow/extension/ecto/schema_test.exs +++ b/test/pow/extension/ecto/schema_test.exs @@ -59,7 +59,7 @@ defmodule Pow.Extension.Ecto.SchemaTest do use Pow.Extension.Ecto.Schema, extensions: [Pow.Extension.Ecto.SchemaTest.ExtensionMock] - @ecto_derive_inspect_for_redacted_fields false + @derive_inspect_for_redacted_fields false schema "users" do pow_user_fields() @@ -83,7 +83,7 @@ defmodule Pow.Extension.Ecto.SchemaTest do use Pow.Extension.Ecto.Schema, extensions: [Pow.Extension.Ecto.SchemaTest.ExtensionMock] - @ecto_derive_inspect_for_redacted_fields false + @derive_inspect_for_redacted_fields false schema "users" do pow_user_fields() diff --git a/test/pow/extension/phoenix/router_test.exs b/test/pow/extension/phoenix/router_test.exs index dc9a3d46..3d78f4a7 100644 --- a/test/pow/extension/phoenix/router_test.exs +++ b/test/pow/extension/phoenix/router_test.exs @@ -9,7 +9,8 @@ defmodule Pow.Extension.Phoenix.RouterTest do # To prevent the `TestController.init/1 is undefined` warnings defmodule ExtensionMock.Phoenix.TestController do - use Phoenix.Controller, namespace: Pow.Extension.Phoenix.RouterTest + use Phoenix.Controller, formats: [] + plug :put_layout, html: Pow.Extension.Phoenix.RouterTest.LayoutView end defmodule ExtensionMock.Phoenix.Router do diff --git a/test/pow/phoenix/controllers/registration_controller_test.exs b/test/pow/phoenix/controllers/registration_controller_test.exs index a125a8b6..7eb25c98 100644 --- a/test/pow/phoenix/controllers/registration_controller_test.exs +++ b/test/pow/phoenix/controllers/registration_controller_test.exs @@ -14,27 +14,27 @@ defmodule Pow.Phoenix.RegistrationControllerTest do assert html = html_response(conn, 200) assert html =~ ~p"/registration" - html_tree = DOM.parse(html) + {html_tree, _} = DOM.parse_document(html) - assert [label_elem] = DOM.all(html_tree, "label[for=user_email]") - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[email]\"]") + assert label_elem = DOM.all(html_tree, "label[for=user_email]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[email]\"]") assert DOM.to_text(label_elem) =~ "Email" assert DOM.attribute(input_elem, "type") == "email" assert DOM.attribute(input_elem, "required") - assert [label_elem] = DOM.all(html_tree, "label[for=user_password]") - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[password]\"]") + assert label_elem = DOM.all(html_tree, "label[for=user_password]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[password]\"]") assert DOM.to_text(label_elem) =~ "Password" assert DOM.attribute(input_elem, "type") == "password" assert DOM.attribute(input_elem, "required") - assert [label_elem] = DOM.all(html_tree, "label[for=user_password_confirmation]") - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[password_confirmation]\"]") + assert label_elem = DOM.all(html_tree, "label[for=user_password_confirmation]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[password_confirmation]\"]") assert DOM.to_text(label_elem) =~ "Confirm password" assert DOM.attribute(input_elem, "type") == "password" assert DOM.attribute(input_elem, "required") - assert [_] = DOM.all(html, "a[href=\"/session/new\"]") + assert _ = DOM.all(html_tree, "a[href=\"/session/new\"]") end test "already signed in", %{conn: conn} do @@ -54,10 +54,10 @@ defmodule Pow.Phoenix.RegistrationControllerTest do assert html = html_response(conn, 200) - html_tree = DOM.parse(html) + {html_tree, _} = DOM.parse_document(html) - assert [label_elem] = DOM.all(html_tree, "label[for=user_username]") - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[username]\"]") + assert label_elem = DOM.all(html_tree, "label[for=user_username]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[username]\"]") assert DOM.to_text(label_elem) =~ "Username" assert DOM.attribute(input_elem, "type") == "text" end @@ -90,13 +90,13 @@ defmodule Pow.Phoenix.RegistrationControllerTest do assert html = html_response(conn, 200) - html_tree = DOM.parse(html) + {html_tree, _} = DOM.parse_document(html) - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[email]\"]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[email]\"]") assert DOM.attribute(input_elem, "value") == "invalid@example.com" - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[password]\"]") - assert [error_elem] = DOM.all(html_tree, "*[phx-feedback-for=\"user[password]\"] > p") + assert input_elem = DOM.all(html_tree, "input[name=\"user[password]\"]") + assert error_elem = DOM.all(html_tree, "*[phx-feedback-for=\"user[password]\"] > p") assert DOM.attribute(input_elem, "value") == "invalid" assert DOM.to_text(error_elem) =~ "should be at least 8 character(s)" @@ -116,30 +116,30 @@ defmodule Pow.Phoenix.RegistrationControllerTest do assert html = html_response(conn, 200) - html_tree = DOM.parse(html) + {html_tree, _} = DOM.parse_document(html) - assert [label_elem] = DOM.all(html_tree, "label[for=user_current_password]") - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[current_password]\"]") + assert label_elem = DOM.all(html_tree, "label[for=user_current_password]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[current_password]\"]") assert DOM.to_text(label_elem) =~ "Current password" assert DOM.attribute(input_elem, "type") == "password" assert DOM.attribute(input_elem, "required") - assert [label_elem] = DOM.all(html_tree, "label[for=user_email]") - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[email]\"]") + assert label_elem = DOM.all(html_tree, "label[for=user_email]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[email]\"]") assert DOM.to_text(label_elem) =~ "Email" assert DOM.attribute(input_elem, "type") == "email" assert DOM.attribute(input_elem, "value") == "mock@example.com" assert DOM.attribute(input_elem, "required") - assert [label_elem] = DOM.all(html_tree, "label[for=user_password]") - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[password]\"]") + assert label_elem = DOM.all(html_tree, "label[for=user_password]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[password]\"]") assert DOM.to_text(label_elem) =~ "New password" assert DOM.attribute(input_elem, "type") == "password" refute DOM.attribute(input_elem, "value") refute DOM.attribute(input_elem, "required") - assert [label_elem] = DOM.all(html_tree, "label[for=user_password_confirmation]") - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[password_confirmation]\"]") + assert label_elem = DOM.all(html_tree, "label[for=user_password_confirmation]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[password_confirmation]\"]") assert DOM.to_text(label_elem) =~ "Confirm new password" assert DOM.attribute(input_elem, "type") == "password" refute DOM.attribute(input_elem, "value") @@ -155,10 +155,10 @@ defmodule Pow.Phoenix.RegistrationControllerTest do assert html = html_response(conn, 200) - html_tree = DOM.parse(html) + {html_tree, _} = DOM.parse_document(html) - assert [label_elem] = DOM.all(html_tree, "label[for=user_username]") - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[username]\"]") + assert label_elem = DOM.all(html_tree, "label[for=user_username]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[username]\"]") assert DOM.to_text(label_elem) =~ "Username" assert DOM.attribute(input_elem, "type") == "text" assert DOM.attribute(input_elem, "value") == "test" @@ -202,15 +202,15 @@ defmodule Pow.Phoenix.RegistrationControllerTest do assert html = html_response(conn, 200) - html_tree = DOM.parse(html) + {html_tree, _} = DOM.parse_document(html) - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[current_password]\"]") - assert [error_elem] = DOM.all(html_tree, "*[phx-feedback-for=\"user[current_password]\"] > p") + assert input_elem = DOM.all(html_tree, "input[name=\"user[current_password]\"]") + assert error_elem = DOM.all(html_tree, "*[phx-feedback-for=\"user[current_password]\"] > p") refute DOM.attribute(input_elem, "value") assert DOM.to_text(error_elem) =~ "can't be blank" - assert [label_elem] = DOM.all(html_tree, "label[for=user_email]") - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[email]\"]") + assert label_elem = DOM.all(html_tree, "label[for=user_email]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[email]\"]") assert DOM.to_text(label_elem) =~ "Email" assert DOM.attribute(input_elem, "type") == "email" assert DOM.attribute(input_elem, "value") == "invalid@example.com" diff --git a/test/pow/phoenix/controllers/session_controller_test.exs b/test/pow/phoenix/controllers/session_controller_test.exs index d4e8f51c..5c289c11 100644 --- a/test/pow/phoenix/controllers/session_controller_test.exs +++ b/test/pow/phoenix/controllers/session_controller_test.exs @@ -24,23 +24,23 @@ defmodule Pow.Phoenix.SessionControllerTest do assert html =~ ~p"/session" refute html =~ "request_path=" - html_tree = DOM.parse(html) + {html_tree, _} = DOM.parse_document(html) - assert [label_elem] = DOM.all(html_tree, "label[for=user_email]") - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[email]\"]") + assert label_elem = DOM.all(html_tree, "label[for=user_email]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[email]\"]") assert DOM.to_text(label_elem) =~ "Email" assert DOM.attribute(input_elem, "type") == "email" refute DOM.attribute(input_elem, "value") assert DOM.attribute(input_elem, "required") - assert [label_elem] = DOM.all(html_tree, "label[for=user_password]") - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[password]\"]") + assert label_elem = DOM.all(html_tree, "label[for=user_password]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[password]\"]") assert DOM.to_text(label_elem) =~ "Password" assert DOM.attribute(input_elem, "type") == "password" refute DOM.attribute(input_elem, "value") assert DOM.attribute(input_elem, "required") - assert [_] = DOM.all(html, "a[href=\"/registration/new\"]") + assert _ = DOM.all(html_tree, "a[href=\"/registration/new\"]") end test "with request_path", %{conn: conn} do @@ -58,10 +58,10 @@ defmodule Pow.Phoenix.SessionControllerTest do assert html = html_response(conn, 200) - html_tree = DOM.parse(html) + {html_tree, _} = DOM.parse_document(html) - assert [label_elem] = DOM.all(html_tree, "label[for=user_username]") - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[username]\"]") + assert label_elem = DOM.all(html_tree, "label[for=user_username]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[username]\"]") assert DOM.to_text(label_elem) =~ "Username" assert DOM.attribute(input_elem, "type") == "text" end @@ -95,12 +95,12 @@ defmodule Pow.Phoenix.SessionControllerTest do assert html = html_response(conn, 200) assert get_flash(conn, :error) == "The provided login details did not work. Please verify your credentials, and try again." - html_tree = DOM.parse(html) + {html_tree, _} = DOM.parse_document(html) - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[email]\"]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[email]\"]") assert DOM.attribute(input_elem, "value") == "invalid@example.com" - assert [input_elem] = DOM.all(html_tree, "input[name=\"user[password]\"]") + assert input_elem = DOM.all(html_tree, "input[name=\"user[password]\"]") refute DOM.attribute(input_elem, "value") refute Plug.current_user(conn)