Declare app/views/notes/index.html.erb
This commit introduces code in response to an error:
Error:
UserSharesAMessageTest#test_visiting_the_index:
AbstractController::ActionNotFound: The action 'index' could not be found for NotesController
To declare an “action”, a controller that extends from
ActionController::Base
can either:
- define an instance method that corresponds to the action (in this
case,
index
) - declare a view file named after the action in the directory that
corresponds to the controller name (in this case,
notes/index.html.erb
)
If a method that corresponds to the action does not exist, Rails will automatically infer which template to render.
This commit relies on that convention.
When running the tests, a new error is raised:
Error:
UserSharesAMessageTest#test_visiting_the_index:
Capybara::ElementNotFound: Unable to find link or button "Share a Note"
test/system/user_shares_a_message_test.rb:8:in `block in <class:UserSharesAMessageTest>'