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 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:20:in
`block (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
configure`config.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*
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/4f23596c-ca6e-465f-81b0-276dded1cadd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.