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")
    end
end

*error returned to console when run: *

Shawns-MacBook-Pro:SafeReporAPP TaurenLTD1$ bin/rspec
spec/features/users/create_spec.rbFFailures: 1) Create User lists
redirects to the users list index page on success Failure/Error:
fill_in “First_Name”, with: “Shawn” Capybara::ElementNotFound:
Unable to find field “First_Name” #
./spec/features/users/create_spec.rb:9:in block (2 levels) in <top (required)>'Deprecation Warnings:--------------------------------------------------------------------------------RSpec::Core::ExampleGroup#example is deprecated and will be removedin RSpec 3. There are a few options for what you can use instead: - rspec-core's DSL methods (it,before,after,let,subject, etc) now yield the example as a block argument, and that is the recommended way to access the current example from those contexts. - The current example is now exposed viaRSpec.current_example, which is accessible from any context. - If you can't update the code at this call site (e.g. because it is in an extension gem), you can use this snippet to continue making this method available in RSpec 2.99 and RSpec 3: RSpec.configure do |c| c.expose_current_running_example_as :example end(Called from /Users/TaurenLTD1/.rvm/gems/ruby-2.2.0/gems/capybara-2.1.0/lib/capybara/rspec.rb:20:inblock (2 levels) in <top
(required)>’)----------------------------------------------------------------------------------------------------------------------------------------------------------------RSpec::Core::ExampleGroup#example
is deprecated and will be removedin RSpec 3. There are a few options for
what you can use instead: - rspec-core’s DSL methods (it, before,
after, let, subject, etc) now yield the example as a block
argument, and that is the recommended way to access the current
example
from those contexts. - The current example is now exposed via
RSpec.current_example, which is accessible from any context. - If
you
can’t update the code at this call site (e.g. because it is in an
extension gem), you can use this snippet to continue making this
method
available in RSpec 2.99 and RSpec 3: RSpec.configure do |c|
c.expose_current_running_example_as :example end(Called from
/Users/TaurenLTD1/.rvm/gems/ruby-2.2.0/gems/capybara-2.1.0/lib/capybara/rspec.rb:21:in
block (2 levels) in <top (required)>')--------------------------------------------------------------------------------If you need more of the backtrace for any of these deprecations toidentify where to make the necessary changes, you can configureconfig.raise_errors_for_deprecations!`, and it will turn
thedeprecation warnings into errors, giving you the full backtrace.2
deprecation warnings totalFinished in 0.06536 seconds1 example, 1
failureFailed examples:rspec ./spec/features/users/create_spec.rb:4 #
Create User lists redirects to the users list index page on
successRandomized with seed 27327

On Sun, Mar 22, 2015 at 9:41 AM, Shawn W. [email protected]
wrote:

  1. Create User lists redirects to the users list index page on success
    Failure/Error: fill_in “First_Name”, with: “Shawn”
    Capybara::ElementNotFound:
    Unable to find field “First_Name”

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


Hassan S. ------------------------ [email protected]
http://about.me/hassanschroeder
twitter: @hassan
Consulting Availability : Silicon Valley or remote

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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs