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 trialJohn Stoveld
4,203 Points1 failed test upon rspec create spec.rb
I get the following error:
2 deprecation warnings total
Finished in 0.07746 seconds
1 example, 1 failure
Failed examples:
rspec ./spec/features/todo_lists/create_spec.rb:4 # Creating todo lists redirects to the todo list index page on success
Randomized with seed 59387
When I run:
bin/rspec spec/features/todo_lists/create_spec.rb
while create_spec.rb reads:
require 'spec_helper'
describe "Creating todo lists" do
it "redirects to the todo list index page on success" do
visit "/todo_lists"
click_link "New Todo list"
expect(page).to have_content("New todo_list")
end
end
I was so frustrated I just grabbed jasons code from the zip folder and copied and pasted thinking I missed something and still got the same error.
Makes me feel a little better.
But sadly - just a little better.
5 Answers
Isaac Sunderland
6,824 PointsWhat does your apps/views/todo_lists/index.html.erb file look like?
Raven Covington
5,943 PointsJohn, I'm having the same problem. The syntax is changed. Jason is using Rspec 2 but the most recent is 3.
Treehouse REALLY needs to update their videos.
Josiah Schaefer
7,489 PointsYeah this is getting ridiculous. I'm ready to give up on this track.
Justin Black
24,793 PointsYou have typos in your code. I'm using the latest ruby, the latest rails, latest everything.
Code should read:
require 'spec_helper'
describe "Creating todo lists" do
it "redirects to the todo list index page on success" do
visit '/todo_lists'
click_link "New Todo list"
expect(page).to have_content("New Todo List")
end
end
Capitalization matters. You did what I did, and typed exactly what he did. I then ran through the same steps he did, and I got my passing results.
Hiroshi Kadokura
8,035 PointsJustin's code worked for me, too.
looks like this code below was the key(worked!).
expect(page).to have_content("New Todo List")
the application title in the video was "New Todo_List" There was an under-bar between "Todo" and "List"
but my Odot app, there is no under-bar. Just "New Todo List" I don't know why this happened but when I fix this, it works. Whenever I add an under-bar, test fails...
Mark Stansbury
2,603 PointsI got it to work using :
click_link "New Todo list"
Note that "list" begins with a lower cap, like the link on the todo_lists page.
expect(page).to have_content("New Todo List")
Note that "List" beings with an upper cap, like the title on the todo_list page.
Why these are different, I do not know.
More importantly, if the classes actually taught us what these lines of code mean or are supposed to do, this wouldn't be such a crap shoot. I'm not sure what the point of these lessons is anymore. We're just watching someone code, without the slightest hint of actual instruction.
John Stoveld
4,203 PointsJohn Stoveld
4,203 PointsEnded up having a freakout and reverse engineered jasons code.
Fear I am not going to get all this down the first time around.
Hard to work with an outdated video and a newer version of ruby.