swt2-intro-exercise / rails-exercise-20-konradh

rails-exercise-20-konradh created by GitHub Classroom
MIT License
0 stars 0 forks source link

New author page should exist #1

Closed swt2public closed 3 years ago

swt2public commented 3 years ago

Scenario

When a user visits the new author page Then the page should render

Hints

Currently, the application contains only a single route (the root at '/', see config/routes.rb), a single view (app/views/home/index.html.erb) and a single controller (app/controllers/home_controller.rb), which connects the two. All available routes of the application can be displayed using rails routes.

Before you begin implementing this feature, write a test to document its absence. The file spec/features/author/new_author_spec.rb already contains the needed test case, it only needs to be un-commented.

The describe block defines which aspect of the the software will be tested here. Specifying the feature type automatically includes helper methods that allow to simulate browser actions in a test. Inside describe, each it block is a single test case. In this example, the test tries to access the URL of the new-author page. This fails because no such path is defined yet.

Commit the failing test case.

Now, this test needs to be made to pass. See the Rails tutorial for instructions to create the appropriate controllers, views and setting up routes for authors. Instead of articles (as in the tutorial), this exercise is concerned with authors. You can learn more about RSpec, the testing framework, in this documentation

Error

Got NameError: undefined local variable or method `new_author_path' for # Did you mean? new_polymorphic_path

1/44 exercise tests have passed

swt2public commented 3 years ago

Sorry, it's not working for me yet:

Scenario

When a user visits the new author page Then the page should render

Error

Got NameError: undefined local variable or method `new_author_path' for # Did you mean? new_polymorphic_path

If you have problems solving this task, please don't hesitate to contact the teaching team!