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! :)