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

Christ khodabakhshi
Christ khodabakhshi
10,916 Points

bin/rake spec does not work after integration tests

Christs-Air:odot christkhodabakhshi$ bin/rake spec
/Users/christkhodabakhshi/.rbenv/versions/2.1.3/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
/Users/christkhodabakhshi/projects/odot/spec/helpers/todo_lists_helper_spec.rb:16:in `<top (required)>': undefined local variable or method `config' for main:Object (NameError)
    from /Users/christkhodabakhshi/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:241:in `load'
    from /Users/christkhodabakhshi/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:241:in `block in load'
    from /Users/christkhodabakhshi/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:232:in `load_dependency'
    from /Users/christkhodabakhshi/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:241:in `load'
    from /Users/christkhodabakhshi/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in `block in load_spec_files'
    from /Users/christkhodabakhshi/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in `each'
    from /Users/christkhodabakhshi/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in `load_spec_files'
    from /Users/christkhodabakhshi/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/command_line.rb:18:in `run'
    from /Users/christkhodabakhshi/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:103:in `run'
    from /Users/christkhodabakhshi/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:17:in `block in autorun'
/Users/christkhodabakhshi/.rbenv/versions/2.1.3/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

2 Answers

Brandon Barrette
Brandon Barrette
20,485 Points

There error is here:

todo_lists_helper_spec.rb:16

Line 16 of your todo_lists_helper_spec.rb file.

Christ khodabakhshi
Christ khodabakhshi
10,916 Points

The problem solved when I deleted

config.expose_current_running_example_as :example

from spec/helpers/todo_lists_helper_spec.rb

I added that to remove warning from spec test. it was wrong ? or ...

Brandon Barrette
Brandon Barrette
20,485 Points

You should add that code to your spec_helper.rb file or rails_helper.rb file if you are using rspec 3. This will remove the depreciation warnings you see in the terminal.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

There's something wrong with line 16 in this file: /projects/odot/spec/helpers/todo_lists_helper_spec.rb