On Fri, Nov 12, 2010 at 8:53 AM, Ben Porterfield <[email protected]>wrote:

> Trying to run unit test in a new rails 3 project. When I follow
> instructions recommended by ruby on rails guides page
> (http://guides.rubyonrails.org/testing.html) I get the following:
>
> ruby test/unit/schedule_weekly_test.rb
> <internal:lib/rubygems/custom_require>:29:in `require': no such file to
> load -- test_helper (LoadError)
>
> After much googling, everyone seems to recommend that the 'fix' is to
> run a test like so:
>
> ruby -I test test/unit/whatever.rb
>
> That it's impossible to run an autogenerated test using the method
> recommended on the guides page is pretty annoying. At any rate, when I
> run it with -I test, I no longer get the test_helper errors, but I get a
> different one:
>
> activesupport-3.0.1/lib/active_support/dependencies.rb:239:in `require':
> no such file to load -- app/models/users/user (LoadError)
>
> I have a users folder in my model path, that I load with:
>
>  config.autoload_paths += %W(/app/model/users)
>
> in application.rb. Any ideas for what I can do to let my tests find the
> files within this folder?
>

This is a shot in the dark, but I recently upgraded an project to Rails 3
and the tests would just not run - no error, just a new command prompt after
a pause. I solved by using the process of elimination to comment out gems in
my gem file --- I think if I remember right I found the culprit to be
'cucumber' (not 'cucumber_rails'). Once I commented this my tests started
working. And 'cucumber' is not necessary to run 'cucumber_rails', so all
ended well. So just an idea to look at your gemfile if you have added
anything.


>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to