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 Build a Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Editing Todo Lists

David Gross
David Gross
19,443 Points

todo_list = options[:title]

I am just trying to make sure I understand the update_rspec tests correctly.

let!(:todo_list)  {  TodoList.create(title: "Groceries", description: "Groecery list.") }

We are using the TodoList.create because we need a todo_list already in the application to be able to update it. The let! is taking a symbol(:todo_list) as a method and running a block of what we want implemented in the test.

 todo_list = options[:todo_list]

the todo_list variable is calling the let!(:todo_list) { TodoList.create(title: "Groceries", description: "Groecery list.")}" so that rspec knows which todo list we are wanting to update.

  todo_list.reload

reload is telling the database to refresh/reload after the todo list has been successfully updated.

Is this correct ?

1 Answer