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 trialSophia He
2,554 PointsHELP!Keep getting this error message!
I follow the exact code from the video, but I keep getting an error message saying there's something wrong about the rb4.
require 'spec_helper'
describe "Editing todo lists" do
it "updates a todo list successfully with correct information" do
todo_list = TodoList.create(title: "Groceries", description: "Grocery list.")
visit "/todo_lists"
within "#{todo_list{todo_list.id}}" do
click_link"Edit"
end
fill_in "Title", with: "New title"
fill_in "Description", with: "New description"
click_button "Update Todo list"
todo_list.reload
expect(page).to have_content("Todo list was successfully updated.")
expect(todo_list.title).to eq("New title")
expect(todo_list.description).to eq("New description")
end
end
2 Answers
Seth Kroger
56,414 PointsIt means that the test failed, ie. the code for editing the todo_lists isn't doing what the test "expects" it to do. Often it's a mistake in the the code you're testing (or you haven't written the code to do what you're testing yet). Sometimes it's a mistake in the test.
First make sure there's a space between click_link and "Edit" and run the test again. If the test still fails then look to the editing code and views in app/
Nathan F.
30,773 PointsHow is your index.html.erb file formatted? What id does it output on elements on the page?
Your test may be failing because Jason told us to make an ID of "todo_list_#{domid}", but your test looks for #todo_list(id) (todo_list1, todo_list2, ...etc). Double-check your HTML markup to make sure it matches what you're looking for in your test. The specific cause of this failure, like expecting a different result, or not being able to find the CSS selector, should be above those lines you copied.
Sophia He
2,554 PointsSophia He
2,554 Pointsand my error message is