You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a user visits the new author page
Then it should have a field 'First name'
Hints
The new-author page looks rather empty, but before adding input fields you should create a test that checks their presence.
Create a new it block with a descriptive name.
Inside the block, after visiting the new-author page, the test should check for input fields.
RSpec uses matchers to check if a given object is valid.
For example, the have_field matchers checks for form input fields in HTML.
For more matchers, see this Capybara cheat sheet or the documentation.
The following code snippet shows how your final test should look.
You can copy&paste this code, but understand what every instruction does before moving on.
it "should have text input for first name, last name, and homepage" do
visit new_author_path
expect(page).to have_field('First name')
expect(page).to have_field('Last name')
expect(page).to have_field('Homepage')
end
After committing the test, add the missing form fields required by the test.
For help, see the Rails tutorial.
Error
Expected to find field "first name" but there were no matches
Estimated progress: 5% complete
The text was updated successfully, but these errors were encountered:
Scenario
When a user visits the new author page
Then it should have a field 'First name'
Hints
The new-author page looks rather empty, but before adding input fields you should create a test that checks their presence.
Create a new
it
block with a descriptive name.Inside the block, after visiting the new-author page, the test should check for input fields.
RSpec uses matchers to check if a given object is valid.
For example, the
have_field
matchers checks for forminput
fields in HTML.For more matchers, see this Capybara cheat sheet or the documentation.
The following code snippet shows how your final test should look.
You can copy&paste this code, but understand what every instruction does before moving on.
After committing the test, add the missing form fields required by the test.
For help, see the Rails tutorial.
Error
Estimated progress: 5% complete
The text was updated successfully, but these errors were encountered: