Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialjaneporter
Courses Plus Student 23,471 Pointsmy creat_spec.rb code failed
the following code
require 'spec_helper'
describe "Creating todo lists" do
it "redirects to the todo list on success" do
visit "/todo_lists"
click_link "New Todo list"
expect(page).to have_content("New Todo list")
end
end
failed with the following:
``` windows command line prompt and command used C:\Users\jporter\Documents\ruby_projects_tth\odot>bundle exec rspec spec/features/todo_lists/create_spec.rb
```windows command line
Failures:
1) Creating todo lists redirects to the todo list on success
Failure/Error: expect(page).to have_content("New Todo list")
expected to find text "New Todo list" in "New Todo List Title Description Back"
# ./spec/features/todo_lists/create_spec.rb:8: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 C:/Ruby21/lib/ruby/gems/2.1.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 C:/Ruby21/lib/ruby/gems/2.1.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.2206 seconds
1 example, 1 failure
Failed examples:
rspec ./spec/features/todo_lists/create_spec.rb:4 # Creating todo lists redirects to the todo list on success
Randomized with seed 23682
how can i fix this?
janeporter
Courses Plus Student 23,471 Pointsi tried to edit this using the markdown cheatsheet...it doesn't seem to work for the command line content. anyway i found the error yesterday and fixed it. thank you for your input though.
Andrew Stelmach
12,583 PointsAndrew Stelmach
12,583 PointsPlease format your code to make it readable - click on the eye symbol when you're editing to preview how the code looks. Use the markdown cheatsheet for guidance.