swt2-intro-exercise / rails-exercise-22-libaumann

rails-exercise-22-libaumann created by GitHub Classroom
MIT License
0 stars 0 forks source link

New author page should exist #1

Open swt2public opened 2 years ago

swt2public commented 2 years ago

Scenario

When a user visits the new author page Then the page should be available at the new_author_path route and should render without errors

Hints

Currently, the application contains a single route (at /, see config/routes.rb), a view (app/views/home/index.html.erb) and a controller (app/controllers/home_controller.rb), connecting them. All available application routes are displayed using the command rails routes.

Before implementing the requested feature, write a test for it. The file spec/features/author/new_author_spec.rb contains the needed test case, it needs to be un-commented.

The describe block defines which aspect will be tested. Specifying the feature type includes helper methods for simulating browser actions in tests. Each it block is a single test case. The test tries to access the path (i.e. the URL) of the "new author" page. This fails because no such path is defined yet.

Run the test (bundle exec rspec) and commit the failing test case.

To make the test pass, see the Rails Guide for creating the appropriate controllers, views and setting up routes for authors. Note: Instead of articles (in the guide), this exercise is concerned with authors.

You can learn more about RSpec, the testing framework here.

Error

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

1 exercise tests have passed. There are 44 in total. You will solve multiple at once towards the end.

swt2public commented 2 years ago

Sorry, it's not working for me yet:

Scenario

When a user visits the new author page Then the page should be available at the new_author_path route and should render without errors

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!

swt2public commented 2 years ago

Sorry, it's not working for me yet:

Scenario

When a user visits the new author page Then the page should be available at the new_author_path route and should render without errors

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!