New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move generators to Ecto 2.0 #1649

merged 6 commits into from Apr 18, 2016

Fix model generator tests

  • Loading branch information...
josevalim committed Apr 17, 2016
commit e5c91463feff32ba92079e1894c04ec6279183b2
@@ -424,9 +424,12 @@ defmodule Mix.Tasks.Phoenix.New do
defp get_ecto_adapter("sqlite", app, module) do
{:sqlite_ecto, Sqlite.Ecto,
dev: [database: "db/#{app}_dev.sqlite"],
test: [database: "db/#{app}_test.sqlite", pool: Ecto.Adapters.SQL.Sandbox],
prod: [database: "db/#{app}_prod.sqlite"]}
dev: [database: "db/#{app}_dev.sqlite"],
test: [database: "db/#{app}_test.sqlite", pool: Ecto.Adapters.SQL.Sandbox],
prod: [database: "db/#{app}_prod.sqlite"],
test_setup_all: "Ecto.Adapters.SQL.Sandbox.mode(#{module}.Repo, :manual)",
test_setup: ":ok = Ecto.Adapters.SQL.Sandbox.checkout(#{module}.Repo)",
test_async: "Ecto.Adapters.SQL.Sandbox.mode(#{module}.Repo, {:shared, self()})"}
defp get_ecto_adapter("mongodb", app, module) do
{:mongodb_ecto, Mongo.Ecto,
@@ -52,7 +52,7 @@ defmodule Mix.Tasks.Phoenix.Gen.ModelTest do
assert file =~ "field :blob, :binary"
assert file =~ "timestamps"
assert file =~ "def changeset"
assert file =~ "~w(name age nicks famous born_at secret desc blob)"
assert file =~ "[:name, :age, :nicks, :famous, :born_at, :secret, :desc, :blob]"
assert_file "test/models/user_test.exs", fn file ->
ProTip! Use n and p to navigate between commits in a pull request.