Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
swt2public opened this issue Nov 6, 2017 · 0 comments

Comments

@swt2public
Copy link

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

MarcelSchmidberger pushed a commit that referenced this issue Nov 6, 2017
Added fields to author form
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant