diff --git a/.travis.yml b/.travis.yml index 59feb931..691535f9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,7 @@ before_script: - psql -c 'create database coherence_test;' -U postgres language: elixir elixir: - - 1.6 - - 1.5 - - 1.4 + - 1.7 otp_release: - 20.0 matrix: diff --git a/README.md b/README.md index 9075f4eb..358906fa 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,7 @@ defmodule MyProject.Accounts.User do def changeset(model, params \\ %{}) do model - |> cast(params, [:name, :email] ++ coherence_fields) # Add this + |> cast(params, ~w(name email)a ++ coherence_fields()) # Add this |> validate_required([:name, :email]) |> validate_format(:email, ~r/@/) |> validate_coherence(params) # Add this @@ -186,7 +186,7 @@ defmodule MyProject.Accounts.User do def changeset(model, params, :password) do model - |> cast(params, ~w(password password_confirmation reset_password_token reset_password_sent_at)) + |> cast(params, ~w(password password_confirmation reset_password_token reset_password_sent_at)a) |> validate_coherence_password_reset(params) end end diff --git a/config/config.exs b/config/config.exs index cf20e45d..eb8c0e21 100644 --- a/config/config.exs +++ b/config/config.exs @@ -6,4 +6,6 @@ config :coherence, Coherence.Mailer, adapter: Swoosh.Adapters.Sendgrid, api_key: "" +config :phoenix, :json_library, Jason + import_config "#{Mix.env()}.exs" diff --git a/config/test.exs b/config/test.exs index ffafa43b..2fb216e3 100644 --- a/config/test.exs +++ b/config/test.exs @@ -12,7 +12,6 @@ config :coherence, TestCoherenceWeb.Endpoint, config :coherence, ecto_repos: [TestCoherence.Repo] config :coherence, TestCoherence.Repo, - adapter: Ecto.Adapters.Postgres, username: System.get_env("DB_USERNAME") || "postgres", password: System.get_env("DB_PASSWORD") || "postgres", database: "coherence_test", diff --git a/lib/coherence/schema.ex b/lib/coherence/schema.ex index dc995541..93b2c717 100644 --- a/lib/coherence/schema.ex +++ b/lib/coherence/schema.ex @@ -505,6 +505,7 @@ defmodule Coherence.Schema do |> options_fields(:lockable) |> options_fields(:unlockable_with_token) |> options_fields(:confirmable) + |> Enum.map(&String.to_atom/1) end defp options_fields(fields, :authenticatable = key) do diff --git a/lib/coherence/web.ex b/lib/coherence/web.ex index 8f466fca..ca98d098 100644 --- a/lib/coherence/web.ex +++ b/lib/coherence/web.ex @@ -31,6 +31,7 @@ defmodule CoherenceWeb do alias Coherence.Config alias Coherence.Controller + alias Coherence.Router.Helpers, as: Routes require Redirects end diff --git a/lib/mix/tasks/coh.clean.ex b/lib/mix/tasks/coh.clean.ex index 9f67e7ae..515e30ca 100644 --- a/lib/mix/tasks/coh.clean.ex +++ b/lib/mix/tasks/coh.clean.ex @@ -47,6 +47,7 @@ defmodule Mix.Tasks.Coh.Clean do import Coherence.Mix.Utils import Mix.Ecto + import Ecto.Migrator, only: [migrations_path: 1] alias Mix.Tasks.Coh.Install diff --git a/lib/mix/tasks/coh.install.ex b/lib/mix/tasks/coh.install.ex index fa879edb..ac1070b3 100644 --- a/lib/mix/tasks/coh.install.ex +++ b/lib/mix/tasks/coh.install.ex @@ -119,6 +119,7 @@ defmodule Mix.Tasks.Coh.Install do import Macro, only: [camelize: 1, underscore: 1] import Mix.Generator import Mix.Ecto + import Ecto.Migrator, only: [migrations_path: 1] import Coherence.Mix.Utils @shortdoc "Configure the Coherence Package" diff --git a/mix.exs b/mix.exs index 9c1175ab..e5ca8f10 100644 --- a/mix.exs +++ b/mix.exs @@ -7,7 +7,7 @@ defmodule Coherence.Mixfile do [ app: :coherence, version: @version, - elixir: "~> 1.3", + elixir: "~> 1.7", elixirc_paths: elixirc_paths(Mix.env()), compilers: [:phoenix, :gettext] ++ Mix.compilers(), build_embedded: Mix.env() == :prod, @@ -30,10 +30,9 @@ defmodule Coherence.Mixfile do applications: [ :logger, :comeonin, - :ecto, + :ecto_sql, :elixir_uuid, :phoenix_swoosh, - :timex_ecto, :tzdata, :plug, :phoenix, @@ -47,23 +46,23 @@ defmodule Coherence.Mixfile do defp deps do [ - {:ecto, "~> 2.0"}, + {:ecto_sql, "~> 3.0"}, {:comeonin, "~> 4.0"}, {:bcrypt_elixir, "~> 1.1"}, - {:phoenix, "~> 1.3"}, - {:phoenix_html, "~> 2.10"}, + {:phoenix, "~> 1.4"}, + {:phoenix_html, "~> 2.12"}, {:gettext, "~> 0.14"}, {:elixir_uuid, "~> 1.2"}, {:phoenix_swoosh, "~> 0.2"}, {:timex, "~> 3.3"}, - {:timex_ecto, "~> 3.3"}, {:floki, "~> 0.19", only: :test}, {:ex_doc, "~> 0.18.0", only: :dev}, {:earmark, "~> 1.2", only: :dev, override: true}, - {:postgrex, ">= 0.0.0", only: :test}, + {:postgrex, "~> 0.14.0", only: :test}, {:dialyxir, "~> 0.5", only: [:dev], runtime: false}, {:credo, "~> 0.8", only: [:dev, :test]}, - {:plug, "~> 1.6"} + {:plug, "~> 1.7.1"}, + {:jason, "~> 1.0"} ] end diff --git a/mix.lock b/mix.lock index 852a963f..ddcd5cfd 100644 --- a/mix.lock +++ b/mix.lock @@ -1,45 +1,42 @@ %{ "bcrypt_elixir": {:hex, :bcrypt_elixir, "1.1.1", "6b5560e47a02196ce5f0ab3f1d8265db79a23868c137e973b27afef928ed8006", [:make, :mix], [{:elixir_make, "~> 0.4", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm"}, "bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm"}, - "certifi": {:hex, :certifi, "2.3.1", "d0f424232390bf47d82da8478022301c561cf6445b5b5fb6a84d49a9e76d2639", [:rebar3], [{:parse_trans, "3.2.0", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm"}, + "certifi": {:hex, :certifi, "2.4.2", "75424ff0f3baaccfd34b1214184b6ef616d89e420b258bb0a5ea7d7bc628f7f0", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm"}, "combine": {:hex, :combine, "0.10.0", "eff8224eeb56498a2af13011d142c5e7997a80c8f5b97c499f84c841032e429f", [:mix], [], "hexpm"}, "comeonin": {:hex, :comeonin, "4.1.1", "c7304fc29b45b897b34142a91122bc72757bc0c295e9e824999d5179ffc08416", [:mix], [{:argon2_elixir, "~> 1.2", [hex: :argon2_elixir, repo: "hexpm", optional: true]}, {:bcrypt_elixir, "~> 0.12.1 or ~> 1.0", [hex: :bcrypt_elixir, repo: "hexpm", optional: true]}, {:pbkdf2_elixir, "~> 0.12", [hex: :pbkdf2_elixir, repo: "hexpm", optional: true]}], "hexpm"}, "connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], [], "hexpm"}, - "credo": {:hex, :credo, "0.10.0", "66234a95effaf9067edb19fc5d0cd5c6b461ad841baac42467afed96c78e5e9e", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"}, - "db_connection": {:hex, :db_connection, "1.1.3", "89b30ca1ef0a3b469b1c779579590688561d586694a3ce8792985d4d7e575a61", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, repo: "hexpm", optional: false]}, {:poolboy, "~> 1.5", [hex: :poolboy, repo: "hexpm", optional: true]}, {:sbroker, "~> 1.0", [hex: :sbroker, repo: "hexpm", optional: true]}], "hexpm"}, + "credo": {:hex, :credo, "0.10.2", "03ad3a1eff79a16664ed42fc2975b5e5d0ce243d69318060c626c34720a49512", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"}, + "db_connection": {:hex, :db_connection, "2.0.2", "440c05518b0bdca0469dafaf45403597430448c1281def14ef9ccaa41833ea1e", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, repo: "hexpm", optional: false]}], "hexpm"}, "decimal": {:hex, :decimal, "1.5.0", "b0433a36d0e2430e3d50291b1c65f53c37d56f83665b43d79963684865beab68", [:mix], [], "hexpm"}, "dialyxir": {:hex, :dialyxir, "0.5.1", "b331b091720fd93e878137add264bac4f644e1ddae07a70bf7062c7862c4b952", [:mix], [], "hexpm"}, - "earmark": {:hex, :earmark, "1.2.6", "b6da42b3831458d3ecc57314dff3051b080b9b2be88c2e5aa41cd642a5b044ed", [:mix], [], "hexpm"}, - "ecto": {:hex, :ecto, "2.2.10", "e7366dc82f48f8dd78fcbf3ab50985ceeb11cb3dc93435147c6e13f2cda0992e", [:mix], [{:db_connection, "~> 1.1", [hex: :db_connection, repo: "hexpm", optional: true]}, {:decimal, "~> 1.2", [hex: :decimal, repo: "hexpm", optional: false]}, {:mariaex, "~> 0.8.0", [hex: :mariaex, repo: "hexpm", optional: true]}, {:poison, "~> 2.2 or ~> 3.0", [hex: :poison, repo: "hexpm", optional: true]}, {:poolboy, "~> 1.5", [hex: :poolboy, repo: "hexpm", optional: false]}, {:postgrex, "~> 0.13.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:sbroker, "~> 1.0", [hex: :sbroker, repo: "hexpm", optional: true]}], "hexpm"}, + "earmark": {:hex, :earmark, "1.3.0", "17f0c38eaafb4800f746b457313af4b2442a8c2405b49c645768680f900be603", [:mix], [], "hexpm"}, + "ecto": {:hex, :ecto, "3.0.3", "018a3df0956636f84eb3033d807485a7d3dea8474f47b90da5cb8073444c4384", [:mix], [{:decimal, "~> 1.5", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:poison, "~> 2.2 or ~> 3.0", [hex: :poison, repo: "hexpm", optional: true]}], "hexpm"}, + "ecto_sql": {:hex, :ecto_sql, "3.0.2", "0e04cbc183b91ea0085c502226befcd237a4ac31c204fd4be8d4db6676b5f10d", [:mix], [{:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.0.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:mariaex, "~> 0.9.1", [hex: :mariaex, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.14.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.2.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm"}, "elixir_make": {:hex, :elixir_make, "0.4.2", "332c649d08c18bc1ecc73b1befc68c647136de4f340b548844efc796405743bf", [:mix], [], "hexpm"}, "elixir_uuid": {:hex, :elixir_uuid, "1.2.0", "ff26e938f95830b1db152cb6e594d711c10c02c6391236900ddd070a6b01271d", [:mix], [], "hexpm"}, "ex_doc": {:hex, :ex_doc, "0.18.4", "4406b8891cecf1352f49975c6d554e62e4341ceb41b9338949077b0d4a97b949", [:mix], [{:earmark, "~> 1.1", [hex: :earmark, repo: "hexpm", optional: false]}], "hexpm"}, - "floki": {:hex, :floki, "0.20.3", "dfb3a71eb99938e330b4156433d55c6d0b188d936c9683d115a8540bac56e019", [:mix], [{:html_entities, "~> 0.4.0", [hex: :html_entities, repo: "hexpm", optional: false]}, {:mochiweb, "~> 2.15", [hex: :mochiweb, repo: "hexpm", optional: false]}], "hexpm"}, - "gettext": {:hex, :gettext, "0.15.0", "40a2b8ce33a80ced7727e36768499fc9286881c43ebafccae6bab731e2b2b8ce", [:mix], [], "hexpm"}, - "hackney": {:hex, :hackney, "1.13.0", "24edc8cd2b28e1c652593833862435c80661834f6c9344e84b6a2255e7aeef03", [:rebar3], [{:certifi, "2.3.1", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "5.1.2", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "1.0.2", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.1", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm"}, + "floki": {:hex, :floki, "0.20.4", "be42ac911fece24b4c72f3b5846774b6e61b83fe685c2fc9d62093277fb3bc86", [:mix], [{:html_entities, "~> 0.4.0", [hex: :html_entities, repo: "hexpm", optional: false]}, {:mochiweb, "~> 2.15", [hex: :mochiweb, repo: "hexpm", optional: false]}], "hexpm"}, + "gettext": {:hex, :gettext, "0.16.1", "e2130b25eebcbe02bb343b119a07ae2c7e28bd4b146c4a154da2ffb2b3507af2", [:mix], [], "hexpm"}, + "hackney": {:hex, :hackney, "1.14.3", "b5f6f5dcc4f1fba340762738759209e21914516df6be440d85772542d4a5e412", [:rebar3], [{:certifi, "2.4.2", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "6.0.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "1.0.2", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.4", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm"}, "html_entities": {:hex, :html_entities, "0.4.0", "f2fee876858cf6aaa9db608820a3209e45a087c5177332799592142b50e89a6b", [:mix], [], "hexpm"}, - "idna": {:hex, :idna, "5.1.2", "e21cb58a09f0228a9e0b95eaa1217f1bcfc31a1aaa6e1fdf2f53a33f7dbd9494", [:rebar3], [{:unicode_util_compat, "0.3.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm"}, - "jason": {:hex, :jason, "1.1.1", "d3ccb840dfb06f2f90a6d335b536dd074db748b3e7f5b11ab61d239506585eb2", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm"}, - "makeup": {:hex, :makeup, "0.5.1", "966c5c2296da272d42f1de178c1d135e432662eca795d6dc12e5e8787514edf7", [:mix], [{:nimble_parsec, "~> 0.2.2", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm"}, - "makeup_elixir": {:hex, :makeup_elixir, "0.8.0", "1204a2f5b4f181775a0e456154830524cf2207cf4f9112215c05e0b76e4eca8b", [:mix], [{:makeup, "~> 0.5.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 0.2.2", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm"}, + "idna": {:hex, :idna, "6.0.0", "689c46cbcdf3524c44d5f3dde8001f364cd7608a99556d8fbd8239a5798d4c10", [:rebar3], [{:unicode_util_compat, "0.4.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm"}, + "jason": {:hex, :jason, "1.1.2", "b03dedea67a99223a2eaf9f1264ce37154564de899fd3d8b9a21b1a6fd64afe7", [:mix], [{:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm"}, "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm"}, "mime": {:hex, :mime, "1.3.0", "5e8d45a39e95c650900d03f897fbf99ae04f60ab1daa4a34c7a20a5151b7a5fe", [:mix], [], "hexpm"}, "mimerl": {:hex, :mimerl, "1.0.2", "993f9b0e084083405ed8252b99460c4f0563e41729ab42d9074fd5e52439be88", [:rebar3], [], "hexpm"}, "mochiweb": {:hex, :mochiweb, "2.18.0", "eb55f1db3e6e960fac4e6db4e2db9ec3602cc9f30b86cd1481d56545c3145d2e", [:rebar3], [], "hexpm"}, - "nimble_parsec": {:hex, :nimble_parsec, "0.2.2", "d526b23bdceb04c7ad15b33c57c4526bf5f50aaa70c7c141b4b4624555c68259", [:mix], [], "hexpm"}, - "parse_trans": {:hex, :parse_trans, "3.2.0", "2adfa4daf80c14dc36f522cf190eb5c4ee3e28008fc6394397c16f62a26258c2", [:rebar3], [], "hexpm"}, - "phoenix": {:hex, :phoenix, "1.3.4", "aaa1b55e5523083a877bcbe9886d9ee180bf2c8754905323493c2ac325903dc5", [:mix], [{:cowboy, "~> 1.0", [hex: :cowboy, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 1.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.3.3 or ~> 1.4", [hex: :plug, repo: "hexpm", optional: false]}, {:poison, "~> 2.2 or ~> 3.0", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm"}, + "parse_trans": {:hex, :parse_trans, "3.3.0", "09765507a3c7590a784615cfd421d101aec25098d50b89d7aa1d66646bc571c1", [:rebar3], [], "hexpm"}, + "phoenix": {:hex, :phoenix, "1.4.0", "56fe9a809e0e735f3e3b9b31c1b749d4b436e466d8da627b8d82f90eaae714d2", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 1.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}], "hexpm"}, "phoenix_html": {:hex, :phoenix_html, "2.12.0", "1fb3c2e48b4b66d75564d8d63df6d53655469216d6b553e7e14ced2b46f97622", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm"}, - "phoenix_pubsub": {:hex, :phoenix_pubsub, "1.1.0", "d55e25ff1ff8ea2f9964638366dfd6e361c52dedfd50019353598d11d4441d14", [:mix], [], "hexpm"}, + "phoenix_pubsub": {:hex, :phoenix_pubsub, "1.1.1", "6668d787e602981f24f17a5fbb69cc98f8ab085114ebfac6cc36e10a90c8e93c", [:mix], [], "hexpm"}, "phoenix_swoosh": {:hex, :phoenix_swoosh, "0.2.0", "a7e0b32077cd6d2323ae15198839b05d9caddfa20663fd85787479e81f89520e", [:mix], [{:phoenix, "~> 1.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.2", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:swoosh, "~> 0.1", [hex: :swoosh, repo: "hexpm", optional: false]}], "hexpm"}, - "plug": {:hex, :plug, "1.6.2", "e06a7bd2bb6de5145da0dd950070110dce88045351224bd98e84edfdaaf5ffee", [:mix], [{:cowboy, "~> 1.0.1 or ~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}], "hexpm"}, - "poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm"}, - "poolboy": {:hex, :poolboy, "1.5.1", "6b46163901cfd0a1b43d692657ed9d7e599853b3b21b95ae5ae0a777cf9b6ca8", [:rebar], [], "hexpm"}, - "postgrex": {:hex, :postgrex, "0.13.5", "3d931aba29363e1443da167a4b12f06dcd171103c424de15e5f3fc2ba3e6d9c5", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 1.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: false]}], "hexpm"}, - "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.1", "28a4d65b7f59893bc2c7de786dec1e1555bd742d336043fe644ae956c3497fbe", [:make, :rebar], [], "hexpm"}, - "swoosh": {:hex, :swoosh, "0.16.1", "bbe8e7fd90099ac9ad4c7ae751a003e1ecd5726962b26f13af7f95e741f81b5c", [:mix], [{:cowboy, "~> 1.0.1 or ~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.12", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mime, "~> 1.1", [hex: :mime, repo: "hexpm", optional: false]}, {:plug, "~> 1.4", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm"}, - "timex": {:hex, :timex, "3.3.0", "e0695aa0ddb37d460d93a2db34d332c2c95a40c27edf22fbfea22eb8910a9c8d", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:gettext, "~> 0.10", [hex: :gettext, repo: "hexpm", optional: false]}, {:tzdata, "~> 0.1.8 or ~> 0.5", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm"}, - "timex_ecto": {:hex, :timex_ecto, "3.3.0", "d5bdef09928e7a60f10a0baa47ce653f29b43d6fee87b30b236b216d0e36b98d", [:mix], [{:ecto, "~> 2.2", [hex: :ecto, repo: "hexpm", optional: false]}, {:timex, "~> 3.1", [hex: :timex, repo: "hexpm", optional: false]}], "hexpm"}, - "tzdata": {:hex, :tzdata, "0.5.17", "50793e3d85af49736701da1a040c415c97dc1caf6464112fd9bd18f425d3053b", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm"}, - "unicode_util_compat": {:hex, :unicode_util_compat, "0.3.1", "a1f612a7b512638634a603c8f401892afbf99b8ce93a45041f8aaca99cadb85e", [:rebar3], [], "hexpm"}, + "plug": {:hex, :plug, "1.7.1", "8516d565fb84a6a8b2ca722e74e2cd25ca0fc9d64f364ec9dbec09d33eb78ccd", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}], "hexpm"}, + "plug_crypto": {:hex, :plug_crypto, "1.0.0", "18e49317d3fa343f24620ed22795ec29d4a5e602d52d1513ccea0b07d8ea7d4d", [:mix], [], "hexpm"}, + "postgrex": {:hex, :postgrex, "0.14.0", "f3d6ffea1ca8a156e0633900a5338a3d17b00435227726baed8982718232b694", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm"}, + "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.4", "f0eafff810d2041e93f915ef59899c923f4568f4585904d010387ed74988e77b", [:make, :mix, :rebar3], [], "hexpm"}, + "swoosh": {:hex, :swoosh, "0.20.0", "9a6c13822c9815993c03b6f8fccc370fcffb3c158d9754f67b1fdee6b3a5d928", [:mix], [{:cowboy, "~> 1.0.1 or ~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:gen_smtp, "~> 0.12", [hex: :gen_smtp, repo: "hexpm", optional: true]}, {:hackney, "~> 1.9", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mime, "~> 1.1", [hex: :mime, repo: "hexpm", optional: false]}, {:plug, "~> 1.4", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm"}, + "telemetry": {:hex, :telemetry, "0.2.0", "5b40caa3efe4deb30fb12d7cd8ed4f556f6d6bd15c374c2366772161311ce377", [:mix], [], "hexpm"}, + "timex": {:hex, :timex, "3.4.2", "d74649c93ad0e12ce5b17cf5e11fbd1fb1b24a3d114643e86dba194b64439547", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:gettext, "~> 0.10", [hex: :gettext, repo: "hexpm", optional: false]}, {:tzdata, "~> 0.1.8 or ~> 0.5", [hex: :tzdata, repo: "hexpm", optional: false]}], "hexpm"}, + "tzdata": {:hex, :tzdata, "0.5.19", "7962a3997bf06303b7d1772988ede22260f3dae1bf897408ebdac2b4435f4e6a", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm"}, + "unicode_util_compat": {:hex, :unicode_util_compat, "0.4.1", "d869e4c68901dd9531385bb0c8c40444ebf624e60b6962d95952775cac5e90cd", [:rebar3], [], "hexpm"}, } diff --git a/priv/templates/coh.install/coherence_web.ex b/priv/templates/coh.install/coherence_web.ex index f01379df..f9bf4def 100644 --- a/priv/templates/coh.install/coherence_web.ex +++ b/priv/templates/coh.install/coherence_web.ex @@ -11,10 +11,11 @@ defmodule <%= web_module %> do # Use all HTML functionality (forms, tags, etc) use Phoenix.HTML - import <%= web_base %>.Router.Helpers import <%= web_base %>.ErrorHelpers import <%= web_base %>.Gettext import <%= web_base %>.Coherence.ViewHelpers + + alias <%= web_base %>.Router.Helpers, as: Routes end end @@ -27,12 +28,12 @@ defmodule <%= web_module %> do import Ecto import Ecto.Query import Plug.Conn - import <%= web_base %>.Router.Helpers import <%= web_base %>.Gettext import Coherence.Controller alias Coherence.Config alias Coherence.Controller + alias <%= web_base %>.Router.Helpers, as: Routes require Redirects end diff --git a/priv/templates/coh.install/models/coherence/invitation.ex b/priv/templates/coh.install/models/coherence/invitation.ex index 0d2fcc4a..465a796b 100644 --- a/priv/templates/coh.install/models/coherence/invitation.ex +++ b/priv/templates/coh.install/models/coherence/invitation.ex @@ -25,7 +25,7 @@ defmodule <%= base %>.Coherence.Invitation do @spec changeset(Ecto.Schema.t(), Map.t()) :: Ecto.Changeset.t() def changeset(model, params \\ %{}) do model - |> cast(params, ~w(name email token)) + |> cast(params, ~w(name email token)a) |> validate_required([:name, :email]) |> unique_constraint(:email) |> validate_format(:email, ~r/@/) diff --git a/priv/templates/coh.install/models/coherence/rememberable.ex b/priv/templates/coh.install/models/coherence/rememberable.ex index cd1a5c2f..27a3d2f7 100644 --- a/priv/templates/coh.install/models/coherence/rememberable.ex +++ b/priv/templates/coh.install/models/coherence/rememberable.ex @@ -30,7 +30,7 @@ defmodule <%= base %>.Coherence.Rememberable do @spec changeset(Ecto.Schema.t(), Map.t()) :: Ecto.Changeset.t() def changeset(model, params \\ %{}) do model - |> cast(params, ~w(series_hash token_hash token_created_at user_id)) + |> cast(params, ~w(series_hash token_hash token_created_at user_id)a) |> validate_required(~w(series_hash token_hash token_created_at user_id)a) end diff --git a/priv/templates/coh.install/models/coherence/user.ex b/priv/templates/coh.install/models/coherence/user.ex index 5f2b21f2..2c8439ab 100644 --- a/priv/templates/coh.install/models/coherence/user.ex +++ b/priv/templates/coh.install/models/coherence/user.ex @@ -18,7 +18,7 @@ defmodule <%= user_schema %> do @spec changeset(Ecto.Schema.t(), Map.t()) :: Ecto.Changeset.t() def changeset(model, params \\ %{}) do model - |> cast(params, [:name, :email] ++ coherence_fields()) + |> cast(params, ~w(name email)a ++ coherence_fields()) |> validate_required([:name, :email]) |> validate_format(:email, ~r/@/) |> unique_constraint(:email) @@ -31,7 +31,7 @@ defmodule <%= user_schema %> do model |> cast( params, - ~w(password password_confirmation reset_password_token reset_password_sent_at) + ~w(password password_confirmation reset_password_token reset_password_sent_at)a ) |> validate_coherence_password_reset(params) end diff --git a/priv/templates/coh.install/templates/coherence/confirmation/new.html.eex b/priv/templates/coh.install/templates/coherence/confirmation/new.html.eex index 9dfe7735..f68c804a 100644 --- a/priv/templates/coh.install/templates/coherence/confirmation/new.html.eex +++ b/priv/templates/coh.install/templates/coherence/confirmation/new.html.eex @@ -2,7 +2,7 @@

<%%= dgettext "coherence", "Resend Confirmation Instructions" %>

-<%%= form_for @changeset, confirmation_path(@conn, :create), [as: :confirmation], fn f -> %> +<%%= form_for @changeset, Routes.confirmation_path(@conn, :create), [as: :confirmation], fn f -> %>
<%%= required_label f, dgettext("coherence", "Email"), class: "control-label" %> diff --git a/priv/templates/coh.install/templates/coherence/invitation/edit.html.eex b/priv/templates/coh.install/templates/coherence/invitation/edit.html.eex index ac0afc1a..7874f8f3 100644 --- a/priv/templates/coh.install/templates/coherence/invitation/edit.html.eex +++ b/priv/templates/coh.install/templates/coherence/invitation/edit.html.eex @@ -1,6 +1,6 @@
-<%%= form_for @changeset, invitation_path(@conn, :create_user), fn f -> %> +<%%= form_for @changeset, Routes.invitation_path(@conn, :create_user), fn f -> %> <%%= if @changeset.action do %>
diff --git a/priv/templates/coh.install/templates/coherence/invitation/new.html.eex b/priv/templates/coh.install/templates/coherence/invitation/new.html.eex index 7e5b1957..31813cca 100644 --- a/priv/templates/coh.install/templates/coherence/invitation/new.html.eex +++ b/priv/templates/coh.install/templates/coherence/invitation/new.html.eex @@ -1,4 +1,4 @@ -<%%= form_for @changeset, invitation_path(@conn, :create), [as: :invitation], fn f -> %> +<%%= form_for @changeset, Routes.invitation_path(@conn, :create), [as: :invitation], fn f -> %> <%%= if @changeset.action do %>

<%%= dgettext "coherence", "Oops, something went wrong! Please check the errors below." %>

@@ -20,7 +20,7 @@ <%%= submit dgettext("coherence", "Send Invitation"), class: "btn btn-primary" %> <%%= link dgettext("coherence", "Cancel"), to: Coherence.Config.logged_out_url("/"), class: "btn" %> <%%= if invitation = @conn.assigns[:invitation] do %> - <%%= link dgettext("coherence", "Resend Invitation!"), to: invitation_path(@conn, :resend, invitation.id), class: "btn" %> + <%%= link dgettext("coherence", "Resend Invitation!"), to: Routes.invitation_path(@conn, :resend, invitation.id), class: "btn" %> <%% end %>
<%% end %> diff --git a/priv/templates/coh.install/templates/coherence/layout/app.html.eex b/priv/templates/coh.install/templates/coherence/layout/app.html.eex index f54d51ef..285b000c 100644 --- a/priv/templates/coh.install/templates/coherence/layout/app.html.eex +++ b/priv/templates/coh.install/templates/coherence/layout/app.html.eex @@ -8,7 +8,7 @@ <%%= Coherence.Config.title() %> - "> + "> @@ -27,6 +27,6 @@
- + diff --git a/priv/templates/coh.install/templates/coherence/password/edit.html.eex b/priv/templates/coh.install/templates/coherence/password/edit.html.eex index 914427ae..41e196a2 100644 --- a/priv/templates/coh.install/templates/coherence/password/edit.html.eex +++ b/priv/templates/coh.install/templates/coherence/password/edit.html.eex @@ -2,7 +2,7 @@

<%%= dgettext "coherence", "Create a New Password" %>

-<%%= form_for @changeset, password_path(@conn, :update, @changeset.data), [as: :password], fn f -> %> +<%%= form_for @changeset, Routes.password_path(@conn, :update, @changeset.data), [as: :password], fn f -> %> <%%= hidden_input f, :reset_password_token %> diff --git a/priv/templates/coh.install/templates/coherence/password/new.html.eex b/priv/templates/coh.install/templates/coherence/password/new.html.eex index b7f80837..9271147a 100644 --- a/priv/templates/coh.install/templates/coherence/password/new.html.eex +++ b/priv/templates/coh.install/templates/coherence/password/new.html.eex @@ -2,7 +2,7 @@

<%%= dgettext "coherence", "Send Reset Password Instructions" %>

-<%%= form_for @changeset, password_path(@conn, :create), [as: :password], fn f -> %> +<%%= form_for @changeset, Routes.password_path(@conn, :create), [as: :password], fn f -> %>
<%%= required_label f, :email, class: "control-label" %> diff --git a/priv/templates/coh.install/templates/coherence/registration/edit.html.eex b/priv/templates/coh.install/templates/coherence/registration/edit.html.eex index 919b2cdd..d9681d11 100644 --- a/priv/templates/coh.install/templates/coherence/registration/edit.html.eex +++ b/priv/templates/coh.install/templates/coherence/registration/edit.html.eex @@ -2,4 +2,4 @@ <%%= render "form.html", changeset: @changeset, label: dgettext("coherence", "Update"), required: [], - action: registration_path(@conn, :update) %> + action: Routes.registration_path(@conn, :update) %> diff --git a/priv/templates/coh.install/templates/coherence/registration/new.html.eex b/priv/templates/coh.install/templates/coherence/registration/new.html.eex index 3af2241b..da8d200f 100644 --- a/priv/templates/coh.install/templates/coherence/registration/new.html.eex +++ b/priv/templates/coh.install/templates/coherence/registration/new.html.eex @@ -2,4 +2,4 @@ <%%= render "form.html", changeset: @changeset, label: dgettext("coherence", "Register"), required: [required: ""], - action: registration_path(@conn, :create) %> + action: Routes.registration_path(@conn, :create) %> diff --git a/priv/templates/coh.install/templates/coherence/registration/show.html.eex b/priv/templates/coh.install/templates/coherence/registration/show.html.eex index 1e69e65b..98633d5e 100644 --- a/priv/templates/coh.install/templates/coherence/registration/show.html.eex +++ b/priv/templates/coh.install/templates/coherence/registration/show.html.eex @@ -18,8 +18,8 @@ -<%%= link dgettext("coherence", "Edit"), to: registration_path(@conn, :edit) %> | +<%%= link dgettext("coherence", "Edit"), to: Routes.registration_path(@conn, :edit) %> | <%%= link dgettext("coherence", "Delete"), - to: registration_path(@conn, :delete), + to: Routes.registration_path(@conn, :delete), method: :delete, data: [confirm: dgettext("coherence", "Are you sure?")] %> diff --git a/priv/templates/coh.install/templates/coherence/session/new.html.eex b/priv/templates/coh.install/templates/coherence/session/new.html.eex index 10d39c69..df545e2e 100644 --- a/priv/templates/coh.install/templates/coherence/session/new.html.eex +++ b/priv/templates/coh.install/templates/coherence/session/new.html.eex @@ -1,6 +1,6 @@
-<%%= form_for @conn, session_path(@conn, :create), [as: :session], fn f -> %> +<%%= form_for @conn, Routes.session_path(@conn, :create), [as: :session], fn f -> %> <%% login_field = Coherence.Config.login_field %>
diff --git a/priv/templates/coh.install/templates/coherence/unlock/new.html.eex b/priv/templates/coh.install/templates/coherence/unlock/new.html.eex index 4bf69f41..41ec27a2 100644 --- a/priv/templates/coh.install/templates/coherence/unlock/new.html.eex +++ b/priv/templates/coh.install/templates/coherence/unlock/new.html.eex @@ -1,6 +1,6 @@
-<%%= form_for @conn, unlock_path(@conn, :create), [as: :unlock], fn f -> %> +<%%= form_for @conn, Routes.unlock_path(@conn, :create), [as: :unlock], fn f -> %>
<%%= required_label f, dgettext("coherence", "Email"), class: "control-label" %> diff --git a/test/controllers/confirmation_controller.exs b/test/controllers/confirmation_controller.exs index e459e69d..c4442027 100644 --- a/test/controllers/confirmation_controller.exs +++ b/test/controllers/confirmation_controller.exs @@ -1,6 +1,6 @@ defmodule CoherenceTest.ConfirmationController do use TestCoherence.ConnCase - import TestCoherenceWeb.Router.Helpers + import TestCoherenceWeb.Router.Helpers, as: Routes setup %{conn: conn} do Application.put_env(:coherence, :opts, [:confirmable, :registerable]) @@ -27,7 +27,7 @@ defmodule CoherenceTest.ConfirmationController do |> TestCoherence.Repo.update!() conn = - post conn, confirmation_path(conn, :create), %{ + post conn, Routes.confirmation_path(conn, :create), %{ "confirmation" => %{"email" => "user@example.com"} } @@ -40,7 +40,7 @@ defmodule CoherenceTest.ConfirmationController do |> TestCoherence.Repo.update!() conn = - post conn, confirmation_path(conn, :create), %{ + post conn, Routes.confirmation_path(conn, :create), %{ "confirmation" => %{"email" => "user@example.com"} } @@ -62,7 +62,7 @@ defmodule CoherenceTest.ConfirmationController do |> TestCoherence.Repo.update!() conn = - post conn, confirmation_path(conn, :create), %{ + post conn, Routes.confirmation_path(conn, :create), %{ "confirmation" => %{"email" => "user@example.com"} } @@ -72,7 +72,7 @@ defmodule CoherenceTest.ConfirmationController do describe "edit" do test "should confirm valid confirmation token", %{conn: conn} do - conn = get(conn, confirmation_path(conn, :edit, "foobar")) + conn = get(conn, Routes.confirmation_path(conn, :edit, "foobar")) assert html_response(conn, 302) user = get_user_by_email("user@example.com") assert user.confirmation_token == nil @@ -81,7 +81,7 @@ defmodule CoherenceTest.ConfirmationController do test "should set email from unconfirmed_email if confirm_email_updates is true", %{conn: conn} do Application.put_env(:coherence, :confirm_email_updates, true) - conn = get(conn, confirmation_path(conn, :edit, "foobar")) + conn = get(conn, Routes.confirmation_path(conn, :edit, "foobar")) assert html_response(conn, 302) user = get_user_by_email("unconfirmed@example.com") assert user.unconfirmed_email == nil @@ -93,7 +93,7 @@ defmodule CoherenceTest.ConfirmationController do conn: conn } do Application.put_env(:coherence, :confirm_email_updates, false) - conn = get(conn, confirmation_path(conn, :edit, "foobar")) + conn = get(conn, Routes.confirmation_path(conn, :edit, "foobar")) assert html_response(conn, 302) user = get_user_by_email("user@example.com") refute user.unconfirmed_email == nil diff --git a/test/schema_test.exs b/test/schema_test.exs index f5923fc1..cce9cd1c 100644 --- a/test/schema_test.exs +++ b/test/schema_test.exs @@ -100,7 +100,7 @@ defmodule CoherenceTest.Schema do assert cs.errors == [ password: {"should be at least %{count} character(s)", - [count: 4, validation: :length, min: 4]} + [count: 4, validation: :length, kind: :min]} ] end diff --git a/test/support/conn_case.exs b/test/support/conn_case.exs index 7bfa6fa0..80616269 100644 --- a/test/support/conn_case.exs +++ b/test/support/conn_case.exs @@ -25,7 +25,7 @@ defmodule TestCoherence.ConnCase do import Ecto.Changeset import Ecto.Query, only: [from: 1, from: 2] - import TestCoherenceWeb.Router.Helpers + alias TestCoherenceWeb.Router.Helpers, as: Routes import TestCoherence.TestHelpers alias Coherence.Config diff --git a/test/support/endpoint.exs b/test/support/endpoint.exs index fe1a1765..1d268ff1 100644 --- a/test/support/endpoint.exs +++ b/test/support/endpoint.exs @@ -24,7 +24,7 @@ defmodule TestCoherenceWeb.Endpoint do plug Plug.Parsers, parsers: [:urlencoded, :multipart, :json], pass: ["*/*"], - json_decoder: Poison + json_decoder: Phoenix.json_library() plug Plug.MethodOverride plug Plug.Head diff --git a/test/support/redirect.exs b/test/support/redirect.exs index f60d21b5..4bb3f2ba 100644 --- a/test/support/redirect.exs +++ b/test/support/redirect.exs @@ -29,25 +29,25 @@ defmodule Coherence.Redirects do ## Examples - import MyProject.Router.Helpers + alias MyProject.Router.Helpers, as: Routes # override the log out action back to the log in page - def session_delete(conn, _), do: redirect(conn, session_path(conn, :new)) + def session_delete(conn, _), do: redirect(conn, Routes.session_path(conn, :new)) # redirect the user to the login page after registering - def registration_create(conn, _), do: redirect(conn, session_path(conn, :new)) + def registration_create(conn, _), do: redirect(conn, Routes.session_path(conn, :new)) # disable the user_return_to feature on login - def session_create(conn, _), do: redirect(conn, landing_path(conn, :index)) + def session_create(conn, _), do: redirect(conn, Routes.landing_path(conn, :index)) """ use Redirects - # Uncomment the import below if adding overrides - # import <%= base %>.Router.Helpers + # Uncomment the alias below if adding overrides + # alias <%= base %>.Router.Helpers, as: Routes # Add function overrides below # Example usage # Uncomment the following line to return the user to the login form after logging out - # def session_delete(conn, _), do: redirect(conn, session_path(conn, :new)) + # def session_delete(conn, _), do: redirect(conn, Routes.session_path(conn, :new)) end diff --git a/test/support/repo.exs b/test/support/repo.exs index 9af2417c..ae656c67 100644 --- a/test/support/repo.exs +++ b/test/support/repo.exs @@ -1,3 +1,3 @@ defmodule TestCoherence.Repo do - use Ecto.Repo, otp_app: :coherence + use Ecto.Repo, otp_app: :coherence, adapter: Ecto.Adapters.Postgres end diff --git a/test/support/schema.exs b/test/support/schema.exs index afe069f4..978dda81 100644 --- a/test/support/schema.exs +++ b/test/support/schema.exs @@ -28,7 +28,7 @@ defmodule TestCoherence.User do model |> cast( params, - ~w(password password_confirmation reset_password_token reset_password_sent_at) + ~w(password password_confirmation reset_password_token reset_password_sent_at)a ) |> validate_coherence_password_reset(params) end @@ -63,7 +63,7 @@ defmodule TestCoherence.Invitation do def changeset(model, params \\ %{}) do model - |> cast(params, ~w(name email token)) + |> cast(params, ~w(name email token)a) |> validate_required([:name, :email]) |> unique_constraint(:email) |> validate_format(:email, ~r/@/) @@ -98,7 +98,7 @@ defmodule TestCoherence.Account do model |> cast( params, - ~w(password password_confirmation reset_password_token reset_password_sent_at) + ~w(password password_confirmation reset_password_token reset_password_sent_at)a ) |> validate_coherence_password_reset(params) end @@ -134,7 +134,7 @@ defmodule TestCoherence.Coherence.User do model |> cast( params, - ~w(password password_confirmation reset_password_token reset_password_sent_at) + ~w(password password_confirmation reset_password_token reset_password_sent_at)a ) |> validate_coherence_password_reset(params) end @@ -155,7 +155,7 @@ defmodule TestCoherence.Coherence.Invitation do def changeset(model, params \\ %{}) do model - |> cast(params, ~w(name email token)) + |> cast(params, ~w(name email token)a) |> validate_required([:name, :email]) |> unique_constraint(:email) |> validate_format(:email, ~r/@/) @@ -194,7 +194,7 @@ defmodule TestCoherence.Coherence.Account do model |> cast( params, - ~w(password password_confirmation reset_password_token reset_password_sent_at) + ~w(password password_confirmation reset_password_token reset_password_sent_at)a ) |> validate_coherence_password_reset(params) end @@ -220,7 +220,7 @@ defmodule TestCoherence.Coherence.Rememberable do def changeset(model, params \\ %{}) do model - |> cast(params, ~w(series_hash token_hash token_created_at user_id)) + |> cast(params, ~w(series_hash token_hash token_created_at user_id)a) |> validate_required(~w(series_hash token_hash token_created_at user_id)a) end diff --git a/test/support/templates/invitation/edit.html.eex b/test/support/templates/invitation/edit.html.eex index 7417b062..62655fae 100644 --- a/test/support/templates/invitation/edit.html.eex +++ b/test/support/templates/invitation/edit.html.eex @@ -1,6 +1,6 @@

Create Account

-<%= form_for @changeset, invitation_path(@conn, :create_user), fn f -> %> +<%= form_for @changeset, Routes.invitation_path(@conn, :create_user), fn f -> %> <%= if @changeset.action do %>
diff --git a/test/support/templates/invitation/new.html.eex b/test/support/templates/invitation/new.html.eex index 583fab0b..88088c5c 100644 --- a/test/support/templates/invitation/new.html.eex +++ b/test/support/templates/invitation/new.html.eex @@ -1,6 +1,6 @@
-<%= form_for @changeset, invitation_path(@conn, :create), [as: :invitation], fn f -> %> +<%= form_for @changeset, Routes.invitation_path(@conn, :create), [as: :invitation], fn f -> %> <%= if @changeset.action do %>

Oops, something went wrong! Please check the errors below.

diff --git a/test/support/templates/layout/app.html.eex b/test/support/templates/layout/app.html.eex index 98e00784..4ec0b792 100644 --- a/test/support/templates/layout/app.html.eex +++ b/test/support/templates/layout/app.html.eex @@ -8,7 +8,7 @@ Hello Test Coherence - "> + "> @@ -27,6 +27,6 @@
- + diff --git a/test/support/views.exs b/test/support/views.exs index f0ca77f4..53b975c5 100644 --- a/test/support/views.exs +++ b/test/support/views.exs @@ -1,7 +1,7 @@ defmodule Coherence.CoherenceView do use Phoenix.HTML use Phoenix.View, root: "web/templates/coherence" - import TestCoherenceWeb.Router.Helpers + alias TestCoherenceWeb.Router.Helpers, as: Routes @seperator {:safe, "  |  "} @@ -22,7 +22,7 @@ defmodule Coherence.CoherenceView do defp recovery_link(conn, user_schema) do if user_schema.recoverable? do - [link("Forgot Your Password?", to: password_path(conn, :new))] + [link("Forgot Your Password?", to: Routes.password_path(conn, :new))] else [] end @@ -30,7 +30,7 @@ defmodule Coherence.CoherenceView do defp unlock_link(conn, _user_schema) do if conn.assigns[:locked] do - [link("Send an unlock email", to: unlock_path(conn, :new))] + [link("Send an unlock email", to: Routes.unlock_path(conn, :new))] else [] end diff --git a/test/support/web.exs b/test/support/web.exs index 1e35ca8a..3cb2f6fa 100644 --- a/test/support/web.exs +++ b/test/support/web.exs @@ -9,7 +9,7 @@ defmodule TestCoherenceWeb.Coherence do use Phoenix.HTML import TestCoherenceWeb.Gettext - import TestCoherenceWeb.Router.Helpers + alias TestCoherenceWeb.Router.Helpers, as: Routes import TestCoherenceWeb.ViewHelpers end end