Ash FrameworkAF
Ash Framework3y ago
6 replies
lifeofdan

Set up testing

Is there any documentation on actually setting up testing? I want to test my resource before I begin trying to implement my ui, but I can't find how to create or run migrations for the "test" postgres db.

I'm new to elixir and phoenix in general so any direction on where to go to find this information would be appreciated.

My current test looks like
defmodule OpenBudget.BudgetTest do
  use OpenBudget.DataCase, async: true
  require Ash.Query

  test "can create budget" do
    user =
      OpenBudget.Accounts.User
      |> Ash.Changeset.for_create(:register_with_password, %{
        email: "test@user.com",
        hashed_password: "password",
        password: "password",
        password_confirmation: "password"
      })
      |> OpenBudget.Accounts.create!()

    assert user.email == "test@user.com"
  end
end


The error I get is in the image attached. This error leads me to believe I need to run migrations for my open_budget_test database but running mix ash_postgres.migrate open_budget_test doesn't seem to do the trick.

Thanks again for any guidance.
image.png
Was this page helpful?