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 trialJason Chow
4,428 Pointscan't pass my edit_spec.rb
MY CODE:
it "displays an error with no title" do update_todo_list todo_list: todo_list, title: "" title = todo_list.title todo_list.reload expect(todo_list.title).to eq(title) expect(page).to have_content("error") end
it "displays an error with too short a title" do
update_todo_list todo_list: todo_list, title: "hi"
expect(page).to have_content("error")
end
it "displays an error with no description" do
update_todo_list todo_list: todo_list, description: ""
expect(page).to have_content("error")
end
it "displays an error with too short description" do
update_todo_list todo_list: todo_list, description: "hi"
expect(page).to have_content("error")
end
end
ERROR MESSAGE:
Failures:
1) Editing todo lists displays an error with too short description Failure/Error: expect(page).to have_content("error") expected to find text "error" in "Todo list was successfully updated. Title: New title Description: New description Edit | Back" # ./spec/features/todo_lists/edit_spec.rb:54:in `block (2 levels) in <top (required)>'
2) Editing todo lists displays an error with too short a title Failure/Error: expect(page).to have_content("error") expected to find text "error" in "Todo list was successfully updated. Title: New title Description: New description Edit | Back" # ./spec/features/todo_lists/edit_spec.rb:44:in `block (2 levels) in <top (required)>'
3) Editing todo lists displays an error with no title Failure/Error: expect(page).to have_content("error") expected to find text "error" in "Todo list was successfully updated. Title: New title Description: New description Edit | Back" # ./spec/features/todo_lists/edit_spec.rb:39:in `block (2 levels) in <top (required)>'
4) Editing todo lists displays an error with no description Failure/Error: expect(page).to have_content("error") expected to find text "error" in "Todo list was successfully updated. Title: New title Description: New description Edit | Back" # ./spec/features/todo_lists/edit_spec.rb:49:in `b
help please.
Jason Chow
4,428 PointsSolved it already, thanks Maximiliane. My mistake was that I hard coded something. thanks! :)
Maximiliane Quel
Courses Plus Student 55,489 Pointsokay. glad it worked out :0)
Maximiliane Quel
Courses Plus Student 55,489 PointsMaximiliane Quel
Courses Plus Student 55,489 PointsCan you post the content of your Todo List model?