Using Mix to Run Phoenix Tests: database "rumbl_test" does not exist

Hi,
I am following the exercises in Programming Phoenix 1.4. On page 147 from the pdf book I read the following text: “We’ve added user authentication, validations, and the like to our videos,
so we’ll start fresh with our VideoController tests. Delete the test/rumbl_web/con-
trollers/video_controller_test.exs file now, followed by the test/rumbl/accounts and
test/rumbl/multimedia directories, and then let’s see where our test suite stands:”

$ mix test

I got this message:

Generated rumbl app
23:06:17.888 [error] Postgrex.Protocol (#PID<0.445.0>) failed to connect: ** (Postgrex.Error) FATAL 3D000 (invalid_catalog_name): database “rumbl_test” does not exist

Is the database required, if so how do I create this database?

I would go for mix command…

$ MIX_ENV=test mix ecto.create
$ MIX_ENV=test mix ecto.migrate

But I am not sure for Phoenix 1.4, as I did not try it yet :frowning:

1 Like

Hi ,

  Thanks for your quick answer. I applied the mix commands and the test succeeded.

  But I got  a new problem as I did testing the User Accounts in chapter "Testing MVC" from the book Programming Phoenix 1.4, see my next help request in Phoenix forum.

Best regards,

Thiel