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_textmatcher:
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
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 inspec/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 thehave_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
Estimated progress: 20% complete