Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby Build a Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Deleting Todo Lists

Jason Chow
Jason Chow
4,428 Points

can'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
Jason Chow
4,428 Points

Solved it already, thanks Maximiliane. My mistake was that I hard coded something. thanks! :)