Testing an Ecto Schema
Learn how to update our tests to test for interactivity with the database.
We'll cover the following...
We'll cover the following...
Updating our tests
Now, we need to add :id, :inserted_at, and :updated_at into the test’s schema definition. Update the @expected_fields_with_types to include the new fields:
After that, the fields and types test should pass, but what if we run the whole file? Run the following command:
It will now yield errors that we haven’t seen yet. Those errors will be for the success test, and the test on casting errors, and the output for both will look similar to the following:
2) test changeset/1 success: returns a ...