From f9d6a1a9ac78d616243750dfd9367d6f7383fa91 Mon Sep 17 00:00:00 2001 From: charles FD Date: Mon, 2 Jan 2017 14:24:15 +0100 Subject: [PATCH] [Ecto 2.1] Update code to fix tests based on Ecto 2.1 update --- mix.exs | 4 ++-- mix.lock | 14 +++++++------- test/apartmentex/tenant_actions_test.exs | 4 ++-- test/support/models/note.ex | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mix.exs b/mix.exs index ce158de..42fbe1e 100644 --- a/mix.exs +++ b/mix.exs @@ -37,8 +37,8 @@ defmodule Apartmentex.Mixfile do # Type "mix help deps" for more examples and options defp deps do [ - {:ecto, "~> 2.0"}, - {:mariaex, "~> 0.7.7", optional: true}, + {:ecto, "~> 2.1"}, + {:mariaex, "~> 0.7", optional: true}, {:postgrex, ">= 0.11.0", optional: true} ] end diff --git a/mix.lock b/mix.lock index 9f5d0f0..3afb1de 100644 --- a/mix.lock +++ b/mix.lock @@ -1,7 +1,7 @@ -%{"connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], []}, - "db_connection": {:hex, :db_connection, "1.0.0-rc.4", "fad1f772c151cc6bde82412b8d72319968bc7221df8ef7d5e9d7fde7cb5c86b7", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, optional: false]}, {:poolboy, "~> 1.5", [hex: :poolboy, optional: true]}, {:sbroker, "~> 1.0.0-beta.3", [hex: :sbroker, optional: true]}]}, - "decimal": {:hex, :decimal, "1.1.2", "79a769d4657b2d537b51ef3c02d29ab7141d2b486b516c109642d453ee08e00c", [:mix], []}, - "ecto": {:hex, :ecto, "2.0.4", "03fd3b9aa508b1383eb38c00ac389953ed22af53811aa2e504975a3e814a8d97", [:mix], [{:db_connection, "~> 1.0-rc.2", [hex: :db_connection, optional: true]}, {:decimal, "~> 1.0", [hex: :decimal, optional: false]}, {:mariaex, "~> 0.7.7", [hex: :mariaex, optional: true]}, {:poison, "~> 1.5 or ~> 2.0", [hex: :poison, optional: true]}, {:poolboy, "~> 1.5", [hex: :poolboy, optional: false]}, {:postgrex, "~> 0.11.2", [hex: :postgrex, optional: true]}, {:sbroker, "~> 1.0-beta", [hex: :sbroker, optional: true]}]}, - "mariaex": {:hex, :mariaex, "0.7.7", "620a636ec2276c3fa031ac528039fc9d2bf7992e050e37a56b3c796511e94d6d", [:mix], [{:db_connection, "~> 1.0.0-rc", [hex: :db_connection, optional: false]}, {:decimal, "~> 1.0", [hex: :decimal, optional: false]}]}, - "poolboy": {:hex, :poolboy, "1.5.1", "6b46163901cfd0a1b43d692657ed9d7e599853b3b21b95ae5ae0a777cf9b6ca8", [:rebar], []}, - "postgrex": {:hex, :postgrex, "0.11.2", "139755c1359d3c5c6d6e8b1ea72556d39e2746f61c6ddfb442813c91f53487e8", [:mix], [{:connection, "~> 1.0", [hex: :connection, optional: false]}, {:db_connection, "~> 1.0-rc", [hex: :db_connection, optional: false]}, {:decimal, "~> 1.0", [hex: :decimal, optional: false]}]}} +%{"connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [], []}, + "db_connection": {:hex, :db_connection, "1.1.0", "b2b88db6d7d12f99997b584d09fad98e560b817a20dab6a526830e339f54cdb3", [:mix], [{:connection, "~> 1.0.2", [hex: :connection, optional: false]}, {:poolboy, "~> 1.5", [hex: :poolboy, optional: true]}, {:sbroker, "~> 1.0", [hex: :sbroker, optional: true]}]}, + "decimal": {:hex, :decimal, "1.3.1", "157b3cedb2bfcb5359372a7766dd7a41091ad34578296e951f58a946fcab49c6", [], []}, + "ecto": {:hex, :ecto, "2.1.1", "fa8bdb14be9992b777036e20f183b8c4300cc012a0fae748529ff89b5423f2dd", [:mix], [{:db_connection, "~> 1.1", [hex: :db_connection, optional: true]}, {:decimal, "~> 1.2", [hex: :decimal, optional: false]}, {:mariaex, "~> 0.8.0", [hex: :mariaex, optional: true]}, {:poison, "~> 2.2 or ~> 3.0", [hex: :poison, optional: true]}, {:poolboy, "~> 1.5", [hex: :poolboy, optional: false]}, {:postgrex, "~> 0.13.0", [hex: :postgrex, optional: true]}, {:sbroker, "~> 1.0", [hex: :sbroker, optional: true]}]}, + "mariaex": {:hex, :mariaex, "0.8.1", "b5e359596628861ab2a277e642beed4d88455a0a02b134ede6eae2391098922a", [:mix], [{:db_connection, "~> 1.1", [hex: :db_connection, optional: false]}, {:decimal, "~> 1.0", [hex: :decimal, optional: false]}]}, + "poolboy": {:hex, :poolboy, "1.5.1", "6b46163901cfd0a1b43d692657ed9d7e599853b3b21b95ae5ae0a777cf9b6ca8", [], []}, + "postgrex": {:hex, :postgrex, "0.13.0", "e101ab47d0725955c5c8830ae8812412992e02e4bd9db09e17abb0a5d82d09c7", [:mix], [{:connection, "~> 1.0", [hex: :connection, optional: false]}, {:db_connection, "~> 1.1", [hex: :db_connection, optional: false]}, {:decimal, "~> 1.0", [hex: :decimal, optional: false]}]}} diff --git a/test/apartmentex/tenant_actions_test.exs b/test/apartmentex/tenant_actions_test.exs index 35b37dc..ea6b2db 100644 --- a/test/apartmentex/tenant_actions_test.exs +++ b/test/apartmentex/tenant_actions_test.exs @@ -104,7 +104,7 @@ defmodule Apartmentex.TenantActionsTest do @repo |> Ecto.Adapters.SQL.query(sql, []) - migration_function.("ERROR (duplicate_table): relation \"notes\" already exists") + migration_function.("ERROR 42P07 (duplicate_table): relation \"notes\" already exists") end defp force_rollback_failure(rollback_function) do @@ -114,6 +114,6 @@ defmodule Apartmentex.TenantActionsTest do @repo |> Ecto.Adapters.SQL.query(sql, []) - rollback_function.("ERROR (undefined_table): table \"notes\" does not exist") + rollback_function.("ERROR 42P01 (undefined_table): table \"notes\" does not exist") end end diff --git a/test/support/models/note.ex b/test/support/models/note.ex index e0a53ef..c6b1585 100644 --- a/test/support/models/note.ex +++ b/test/support/models/note.ex @@ -8,6 +8,6 @@ defmodule Apartmentex.Note do def changeset(model, params \\ :empty) do model - |> cast(params, ~w(body), []) + |> cast(params, ~w(body)) end end