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 Write Our First Tests

bin/rake spec get 30 examples, 12 failures, 2 pending

i get 12 failures when first test , and here's the error :

Failed examples:

rspec ./spec/controllers/todo_lists_controller_spec.rb:152 # TodoListsController DELETE destroy redirects to the todo_lists list rspec ./spec/controllers/todo_lists_controller_spec.rb:134 # TodoListsController PUT update with invalid params re-renders the 'edit' template rspec ./spec/controllers/todo_lists_controller_spec.rb:126 # TodoListsController PUT update with invalid params assigns the todo_list as @todo_list rspec ./spec/controllers/todo_lists_controller_spec.rb:112 # TodoListsController PUT update with valid params assigns the requested todo_list as @todo_list rspec ./spec/controllers/todo_lists_controller_spec.rb:33 # TodoListsController GET index assigns all todo_lists as @todo_lists rspec ./spec/controllers/todo_lists_controller_spec.rb:91 # TodoListsController POST create with invalid params re-renders the 'new' template rspec ./spec/controllers/todo_lists_controller_spec.rb:84 # TodoListsController POST create with invalid params assigns a newly created but unsaved todo_list as @todo_list rspec ./spec/controllers/todo_lists_controller_spec.rb:71 # TodoListsController POST create with valid params assigns a newly created todo_list as @todo_list rspec ./spec/controllers/todo_lists_controller_spec.rb:41 # TodoListsController GET show assigns the requested todo_list as @todo_list rspec ./spec/controllers/todo_lists_controller_spec.rb:49 # TodoListsController GET new assigns a new todo_list as @todo_list rspec ./spec/controllers/todo_lists_controller_spec.rb:56 # TodoListsController GET edit assigns the requested todo_list as @todo_list

please help me thanks

I'm in the same boat. Executing the following "bin/rspec spec/features/todo_lists/create_spec.rb" Yeilds a truck load of Deprecation Warnings, examples and ultimately failures. With me not knowing jack about testing it's impossible for me to troubleshoot this. I'm using rspec-rails (2.99.0)

Any help much appreciated otherwise will just blindly follow along and ignore for now ^ - ^

A same boat here.

Most likely due to using Rail 5.0, and Ruby 2.3.

1 Answer

Here is the Fix;

Download the project files

Overwrite your project with these files.

In terminal enter:

$ gem install json

$ bundle update

$ bundle install

then run rspec to verify