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 trial

Ruby

Jeff Wolfram
Jeff Wolfram
10,490 Points

Having trouble with edit todo list. Keeps throwing an error with line 4

Can someone please help me with this? This is the error I am getting... 2 deprecation warnings total

Finished in 0.29314 seconds 1 example, 1 failure

Failed examples:

rspec ./spec/features/todo_lists/edit_spec.rb:4 # Editing todo lists updates a todo list successfully with correct information

Randomized with seed 4174

Here is my code on the edit_spec.rb

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

and this is the code on the index page

<h1>Listing Todo lists</h1>

<table>
  <thead>
    <tr>
      <th>Title</th>
      <th>Description</th>
      <th colspan="3"></th>
    </tr>
  </thead>

  <tbody>
    <% @todo_lists.each do |todo_list| %>
      <tr id="<%= dom_id(todo_list) %>">
        <td><%= todo_list.title %></td>
        <td><%= todo_list.description %></td>
        <td><%= link_to 'Show', todo_list %></td>
        <td><%= link_to 'Edit', edit_todo_list_path(todo_list) %></td>
        <td><%= link_to 'Destroy', todo_list, method: :delete, data: { confirm: 'Are you sure?' } %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<br>

<%= link_to 'New Todo list', new_todo_list_path %>

I know I am missing something but I can not figure it out. It looks just like what they typed in the video.

1 Answer

Jeff Wolfram
Jeff Wolfram
10,490 Points

Never mind. I figured it out. I missed a capital letter. I must have looked it over 500 times. I guess it was going to take me 501 =)