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 trialcp88
5,039 PointsError during "Build a Todo List Application" when watching "Adding Todo Items" video
I'm receiving an error when running the following command and not sure why. I've gone through the video twice and checked my code, plus I've downloaded the project files and compared them to the ones I've edited during this video using a comparison tool and still don't know where I'm going wrong :( Please can somebody help?
treehouse:~/projects/odot (master *) $ bin/rspec --format=documentation spec/features/todo_items/create_spec.rb
Adding todo items
is successful with valid content (FAILED - 1)
Failures:
1) Adding todo items is successful with valid content
Failure/Error: expect(page).to have_content("Added todo list item.")
expected to find text "Added todo list item." in "Added todo list item Grocery list Milk New Todo Item"
# ./spec/features/todo_items/create_spec.rb:18:in `block (2 levels) in <top (required)>'
Finished in 1.45 seconds
1 example, 1 failure
Failed examples:
rspec ./spec/features/todo_items/create_spec.rb:13 # Adding todo items is successful with valid content
Randomized with seed 28863
treehouse:~/projects/odot (master *) $
1 Answer
Maciej Czuchnowski
36,441 PointsIt seems like the test is looking for a dot at the end of that sentence and it's not there when the page loads. Try changing the expectation from "Added todo list item." to "Added todo list item"
cp88
5,039 Pointscp88
5,039 PointsOh Maciej, you are a genius. There was a full stop discrepancy but I thought it didn't matter as it was only in a string! But if you're comparing two strings it will matter!
Thank you :D I will trace through the files and add the full stop so it matches Jason's video.