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