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 Deleting Todo Lists

Akbar Mahmood
Akbar Mahmood
6,118 Points

rake spec error. rake spec does not pass after adding destroy_spec.rb

I have tried the suggestions made as responses for questions regarding this issue. Although my errors are different from those posted by others; this seems to be the case at a glance at least.

Any advice or hint as to the direction i should pursue will be highly appreciated if a direct fix cannot be suggested.

Thank You in advance. You will find the error message returned below.

treehouse:~/projects/odot (master *) $ rake spec
/home/treehouse/.rbenv/versions/2.0.0-p353/bin/ruby -S rspec ./spec/controllers/todo_lists_controller_spec.rb ./spec/features/todo_lists/create_spec.rb ./spec/features/todo_lists/destroy_spec.rb ./spec/features/todo_lists/edit_spec.rb ./spec/helpers/todo_lists_helper_spec.rb ./spec/models/todo_list_spec.rb ./spec/requests/todo_lists_spec.rb ./spec/routing/todo_lists_routing_spec.rb ./spec/views/todo_lists/edit.html.erb_spec.rb ./spec/views/todo_lists/index.html.erb_spec.rb ./spec/views/todo_lists/new.html.erb_spec.rb ./spec/views/todo_lists/show.html.erb_spec.rb
/home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/formatters/deprecation_formatter.rb:187:in `puts': -------------------------------------------------------------------------------- (RSpec::Core::DeprecationError)
The semantics of `RSpec::Core::ExampleGroup.pending` are changing in RSpec 3.
In RSpec 2.x, it caused the example to be skipped. In RSpec 3, the example will
still be run but is expected to fail, and will be marked as a failure (rather
than as pending) if the example passes, just like how `pending` with a block
from within an example already works.

To keep the same skip semantics, change `pending` to `skip`.  Otherwise, if you
want the new RSpec 3 behavior, you can safely ignore this warning and continue
to upgrade to RSpec 3 without addressing it.

Called from /home/treehouse/projects/odot/spec/helpers/todo_lists_helper_spec.rb:14:in `block in <top (required)>'.

--------------------------------------------------------------------------------
        from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/formatters/deprecation_formatter.rb:124:in `print_deprecation_message'
        from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/formatters/deprecation_formatter.rb:32:in `deprecation'
        from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/reporter.rb:130:in `block in notify'
        from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/reporter.rb:129:in `each'
        from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/reporter.rb:129:in `notify'
        from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/reporter.rb:101:in `deprecation'
        from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/deprecation.rb:20:in `warn_deprecation'
        from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/example_group.rb:77:in `pending'
        from /home/treehouse/projects/odot/spec/helpers/todo_lists_helper_spec.rb:14:in `block in <top (required)>'
        from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/example_group.rb:369:in `module_eval'
        from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/example_group.rb:369:in `subclass'
        from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/example_group.rb:342:in `describe'
        from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/dsl.rb:18:in `describe'
        from /home/treehouse/projects/odot/spec/helpers/todo_lists_helper_spec.rb:13:in `<top (required)>'
        from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:223:in `load'
        from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:223:in `block in load'
        from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:214:in `load_dependency'
        from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.0.1/lib/active_support/dependencies.rb:223:in `load'
        from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in `block in load_spec_files'
        from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in `each'
        from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in `load_spec_files'
        from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/command_line.rb:18:in `run'
        from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:103:in `run'
        from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:17:in `block in autorun'
/home/treehouse/.rbenv/versions/2.0.0-p353/bin/ruby -S rspec ./spec/controllers/todo_lists_controller_spec.rb ./spec/features/todo_lists/create_spec.rb ./spec/features/todo_lists/destroy_spec.rb ./spec/features/todo_lists/edit_spec.rb ./spec/helpers/todo_lists_helper_spec.rb ./spec/models/todo_list_spec.rb ./spec/requests/todo_lists_spec.rb ./spec/routing/todo_lists_routing_spec.rb ./spec/views/todo_lists/edit.html.erb_spec.rb ./spec/views/todo_lists/index.html.erb_spec.rb ./spec/views/todo_lists/new.html.erb_spec.rb ./spec/views/todo_lists/show.html.erb_spec.rb failed

do you have this project checked in to github?

Akbar Mahmood
Akbar Mahmood
6,118 Points

jason phillips yes https://github.com/syedakbar/todoapp . the latest commit was after completing the edit feature.

I think you did the commit but didn't push to github. I do not see the destryo_spec file. Can you push these changes up?

Akbar Mahmood
Akbar Mahmood
6,118 Points

jason phillips i should let you know that after receiving the aforementioned errors I changed the "pending" to skip as suggested in the "todo_lists_helper_spec.rb" and "todo_list_spec.rb" files.

When you run rake spec for the most recent commit you should get the following errors:

treehouse:~/projects/odot (master) $ rake spec
/home/treehouse/.rbenv/versions/2.0.0-p353/bin/ruby -S rspec ./spec/controllers/todo_lists_controller_spec.rb .
/spec/features/todo_lists/create_spec.rb ./spec/features/todo_lists/destroy_spec.rb ./spec/features/todo_lists/
edit_spec.rb ./spec/helpers/todo_lists_helper_spec.rb ./spec/models/todo_list_spec.rb ./spec/requests/todo_list
s_spec.rb ./spec/routing/todo_lists_routing_spec.rb ./spec/views/todo_lists/edit.html.erb_spec.rb ./spec/views/
todo_lists/index.html.erb_spec.rb ./spec/views/todo_lists/new.html.erb_spec.rb ./spec/views/todo_lists/show.htm
l.erb_spec.rb
......*.............FFFF*................

Pending:
  TodoList add some examples to (or delete) /home/treehouse/projects/odot/spec/models/todo_list_spec.rb
    # No reason given
    # ./spec/models/todo_list_spec.rb:4
  TodoListsHelper add some examples to (or delete) /home/treehouse/projects/odot/spec/helpers/todo_lists_helper
_spec.rb
    # No reason given
    # ./spec/helpers/todo_lists_helper_spec.rb:14

Failures:

  1) todo_lists/show renders attributes in <p>
     Failure/Error: @todo_list = assign(:todo_list, stub_model(TodoList,
       `stub_model` is deprecated. Use the `rspec-activemodel-mocks` gem instead. Called from /home/treehouse/p
rojects/odot/spec/views/todo_lists/show.html.erb_spec.rb:5:in `block (2 levels) in <top (required)>'.
     # ./spec/views/todo_lists/show.html.erb_spec.rb:5:in `block (2 levels) in <top (required)>'

  2) todo_lists/edit renders the edit todo_list form
     Failure/Error: @todo_list = assign(:todo_list, stub_model(TodoList,
       `stub_model` is deprecated. Use the `rspec-activemodel-mocks` gem instead. Called from /home/treehouse/p
rojects/odot/spec/views/todo_lists/edit.html.erb_spec.rb:5:in `block (2 levels) in <top (required)>'.
     # ./spec/views/todo_lists/edit.html.erb_spec.rb:5:in `block (2 levels) in <top (required)>'

  3) todo_lists/index renders a list of todo_lists
     Failure/Error: stub_model(TodoList,
       `stub_model` is deprecated. Use the `rspec-activemodel-mocks` gem instead. Called from /home/treehouse/p
rojects/odot/spec/views/todo_lists/index.html.erb_spec.rb:6:in `block (2 levels) in <top (required)>'.
     # ./spec/views/todo_lists/index.html.erb_spec.rb:6:in `block (2 levels) in <top (required)>'

  4) todo_lists/new renders new todo_list form
     Failure/Error: assign(:todo_list, stub_model(TodoList,
       `stub_model` is deprecated. Use the `rspec-activemodel-mocks` gem instead. Called from /home/treehouse/p
rojects/odot/spec/views/todo_lists/new.html.erb_spec.rb:5:in `block (2 levels) in <top (required)>'.
     # ./spec/views/todo_lists/new.html.erb_spec.rb:5:in `block (2 levels) in <top (required)>'

4 deprecations found.

Finished in 2.39 seconds
41 examples, 4 failures, 2 pending

Failed examples:

rspec ./spec/views/todo_lists/show.html.erb_spec.rb:11 # todo_lists/show renders attributes in <p>
rspec ./spec/views/todo_lists/edit.html.erb_spec.rb:11 # todo_lists/edit renders the edit todo_list form
rspec ./spec/views/todo_lists/index.html.erb_spec.rb:17 # todo_lists/index renders a list of todo_lists
rspec ./spec/views/todo_lists/new.html.erb_spec.rb:11 # todo_lists/new renders new todo_list form

Randomized with seed 6341

/home/treehouse/.rbenv/versions/2.0.0-p353/bin/ruby -S rspec ./spec/controllers/todo_lists_controller_spec.rb .
/spec/features/todo_lists/create_spec.rb ./spec/features/todo_lists/destroy_spec.rb ./spec/features/todo_lists/
edit_spec.rb ./spec/helpers/todo_lists_helper_spec.rb ./spec/models/todo_list_spec.rb ./spec/requests/todo_list
s_spec.rb ./spec/routing/todo_lists_routing_spec.rb ./spec/views/todo_lists/edit.html.erb_spec.rb ./spec/views/
todo_lists/index.html.erb_spec.rb ./spec/views/todo_lists/new.html.erb_spec.rb ./spec/views/todo_lists/show.htm
l.erb_spec.rb failed

Here is a good place to start: this is the sytax that replaces stub

@todo_list = assign(:todo_list, TodoList.create!(title: "My Todo List", description: "This is my todo list"))