prix-fixe

Expand History Expand History
Collapse History Collapse History

Add failing system test

Card:

When I have spare time, I want to know what others think, So that I can learn


This commit declares a system test that specifies that visiting the application’s root path (i.e. GET /) will render the content of already existing Note records.

The test’s Setup Phase invokes the Note.create! with the intention of creating a row in the notes database table.

Up until this point in the process, we’ve referred to the concept of our application’s shared messages as “notes”. Choosing “note” as our domain term is inspired by the W3C ActivityPub Specification. Specifically, the Mastodon Federated Social Networking Platform exclusively supports Activities of type “Note”.

The notes database table does not yet exist, and neither does the class that defines the ActiveRecord-backed Note model.

When the test is executed, it fails:

Error:
UserDiscoversANoteTest#test_from_the_root:
NameError: uninitialized constant UserDiscoversANoteTest::Note
    test/system/user_discovers_a_note_test.rb:5:in `block in <class:UserDiscoversANoteTest>'

This failure message communicates the fact that we have not yet codified the concept of a “note” in our application’s domain models.