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.

Alan Dunbar
573 Pointsspec_helper not working in test
$ bin/rspec spec/features/todo_items/create_spec.rb
todo/spec/spec_helper.rb:22:in block in <top (required)>': uninitialized constant RailsDomIdHelper (NameError)
from /.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core.rb:154:in
configure'
not sure what is going on but the test seems to fail
1 Answer

Alan Dunbar
573 PointsTried that and this is what I get:
alans-mbp:todo justme$ bin/rake
/Users/justme/.rbenv/versions/2.0.0-p353/bin/ruby -S rspec ./spec/controllers/todo_items_controller_spec.rb ./spec/controllers/todo_lists_controller_spec.rb ./spec/features/todo_items/complete_spec.rb ./spec/features/todo_items/create_spec.rb ./spec/features/todo_items/delete_spec.rb ./spec/features/todo_items/edit_spec.rb ./spec/features/todo_items/index_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_items_helper_spec.rb ./spec/helpers/todo_lists_helper_spec.rb ./spec/models/todo_item_spec.rb ./spec/models/todo_list_spec.rb ./spec/requests/todo_lists_spec.rb ./spec/routing/todo_lists_routing_spec.rb ./spec/views/todo_items/index.html.erb_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/justme/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in require': /Users/justme/Projects/todo/app/models/todo_item.rb:14: syntax error, unexpected keyword_end, expecting end-of-input (SyntaxError)
from /Users/justme/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in
block in require'
from /Users/justme/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:in load_dependency'
from /Users/justme/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in
require'
from /Users/justme/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:348:in require_or_load'
from /Users/justme/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:480:in
load_missing_constant'
from /Users/justme/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:180:in const_missing'
from /Users/justme/Projects/todo/spec/models/todo_item_spec.rb:3:in
<top (required)>'
from /Users/justme/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in load'
from /Users/justme/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in
block in load'
from /Users/justme/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:in load_dependency'
from /Users/justme/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:241:in
load'
from /Users/justme/.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 /Users/justme/.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 /Users/justme/.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 /Users/justme/.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 /Users/justme/.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 /Users/justme/.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'
/Users/justme/.rbenv/versions/2.0.0-p353/bin/ruby -S rspec ./spec/controllers/todo_items_controller_spec.rb ./spec/controllers/todo_lists_controller_spec.rb ./spec/features/todo_items/complete_spec.rb ./spec/features/todo_items/create_spec.rb ./spec/features/todo_items/delete_spec.rb ./spec/features/todo_items/edit_spec.rb ./spec/features/todo_items/index_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_items_helper_spec.rb ./spec/helpers/todo_lists_helper_spec.rb ./spec/models/todo_item_spec.rb ./spec/models/todo_list_spec.rb ./spec/requests/todo_lists_spec.rb ./spec/routing/todo_lists_routing_spec.rb ./spec/views/todo_items/index.html.erb_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
Brandon Willmott
2,837 PointsBrandon Willmott
2,837 PointsBecause there's a reference to RailsDomIdHelper, I'm curious if you forgot to make line 16 in app/views/todo_lists/index.html.erb read:
<tr id="<%= dom_id(todo_list) %>">