prix-fixe

Expand History Expand History
Collapse History Collapse History

Run the create_notes migration

This commit resolves the previous error:

Migrations are pending. To resolve this issue, run:

        rails db:migrate RAILS_ENV=test

Before running the suggested command, this commit introduces a NOT NULL database constraint to the notes.content column, preventing it from accepting NULL values. It’s important to make this modification to the generated migration before executing the migration.

To do so, this commit adds a null: false option to the Table#text declaration, then runs the migration:

rails db:migrate

To ensure that our NOT NULL database constraint is enforced, this commit introduces our first model test.

When we execute the test, it passes:

rails test test/models/note_test.rb

When our system tests are re-run, there is a new error:

Failure:
  UserDiscoversANoteTest#test_from_the_root [/Users/seanpdoyle/src/prix-fixe/test/system/user_discovers_a_note_test.rb:9]:
  expected to find text "Hello, World" in "Share a Note"