Ben Porterfield wrote in post #960978:
> Trying to run unit test in a new rails 3 project.

RSpec's a lot nicer; I'd recommend that instead.  But...

> When I follow
> instructions recommended by ruby on rails guides page
> (http://guides.rubyonrails.org/testing.html)

How are you following those instructions?  I think that page recommends 
using the rake tasks, not running the tests as you've indicated.

> 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?

Use the Rake tasks.  They should set up everything correctly.  I also 
highly recommend the use of Autotest.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

-- 
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].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to