hpi-swt2-exercise / rails-exercise-17-swteam

rails-exercise-17-swteam created by GitHub Classroom
MIT License
0 stars 1 forks source link

New author page should have text input for first name, last name, and homepage #2

Closed swt2public closed 6 years ago

swt2public commented 6 years ago

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 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