swt2-intro-exercise / rails-exercise-18-Kenneth-Schroeder

rails-exercise-18-Kenneth-Schroeder created by GitHub Classroom
MIT License
1 stars 0 forks source link

Author page should display author details #6

Open swt2public opened 5 years ago

swt2public commented 5 years ago

Scenario

Given an author named 'Alan Turing' When a user visits the author's page Then no error should occour

Hints

There should be a page that shows all of an author's details: the show page / details page.

Did you know? You can use FactoryBot.create :author to create and save a valid author object in your tests. If you un-comment the code in spec/factories/authors.rb, the author will be initialized with meaningful values.

To visit the details page of an author in a test, you can use visit author_path(@alan).

You should create a separate file for feature tests for the author details page, make sure it ends with _spec.rb, so that RSpec recognizes it as a test and runs it. You can test for the existence of text on a page using the have_text matcher: expect(page).to have_text(...).

In order to implement the required behavior a show action on the AuthorsController as well as a new view (app/views/authors/show.html.erb) will be needed. The relevant section of the Ruby on Rails guide for this is here.

Error

Got AbstractController::ActionNotFound: The action 'show' could not be found for AuthorsController

Estimated progress: 20% complete