Rspec Testing issues -- Beginner Coder and not sure where to start in troubleshooting this.

Im a noob to ROR and programming in general. i know enough to be dangerous but not enough to figure out where the hell i’m going wrong here. so this is what ive done so far.

  • wrote test:

  • tried to run test to enter text into 2 string fields (see below for errors)

thanks for your help with this!

Testing with Rspec and Capybara

**Testing Code used to run: **

require ‘spec_helper’

describe “Create User lists” do

it “redirects to the users list index page on success” do

visit “/users”

click_link “New User”

expect(page).to have_content(“New User”)

fill_in “First_Name”, with: “Shawn”

fill_in “Last_Name”, with: “Wilson”

click_button “Create User”

expect(page).to have_content(“Shawn”)



**error returned to console when run: **

Shawns-MacBook-Pro:SafeReporAPP TaurenLTD1$ bin/rspec spec/features/users/create_spec.rb



  1. Create User lists redirects to the users list index page on success

Failure/Error: fill_in “First_Name”, with: “Shawn”


Unable to find field “First_Name”

./spec/features/users/create_spec.rb:9:in `block (2 levels) in <top (required)>’

Deprecation Warnings:

The message seems pretty straightforward: are you absolutely sure
that "First_Name" is a label on the page? I would normally expect
human-readable text like e.g. "First name".

Can you passte your html/view code???

Hassan is correct. I would check the value used in the name property of the field. First_Name is not the same as first_name.