[rspec-users] Rspec include paths

David Chelimsky dchelimsky at gmail.com
Sat Jun 9 03:54:39 UTC 2012

On Fri, Jun 8, 2012 at 4:03 PM, Michael Madrid <lists at ruby-forum.com> wrote:
> 'm using rspec 2.10 with Rails 3.2.1 and have problems with classes not
> being found.
> I have put a class called DbTasks under a dir app/util. Under spec, i've
> created file util/db_tasks_spec.rb which runs afer i included the line:
> require File.join(File.dirname(FILE), '../../app/util/db_tasks')
> However, rspec now isn't able to find my models. I don't want to have to
> include these manually. Is there a way to config rspecs paths so
> everything gets found?

Add 'app/util' to config.autoload_paths in config/application.rb.
That's where it belongs (not in your rspec config).

More information about the rspec-users mailing list