Ruby on Rails Monday, March 23, 2015

Can you passte your html/view code???

On Sunday, March 22, 2015 at 2:02:13 PM UTC-4, Shawn Wilson wrote:
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.rb
F

Failures:

  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 removed
in 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 removed
in 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 to
identify where to make the necessary changes, you can configure
`config.raise_errors_for_deprecations!`, and it will turn the
deprecation warnings into errors, giving you the full backtrace.

2 deprecation warnings total

Finished in 0.06536 seconds
1 example, 1 failure

Failed examples:

rspec ./spec/features/users/create_spec.rb:4 # Create User lists redirects to the users list index page on success

Randomized 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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b297362d-4f12-4999-84c4-27f731212af1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment