Rails2.0 the official support of namespace, making it easier for
people with the usual habit of definition Controller
For example,We define the following Controller
admin/hacks_controller
this class namespace is Admin::HackController
When we use rspec_autotest for testing,Will be following error
no such file to load – ./spec/views/hacks/…/…/spec_helper
(LoadError)
The wrong reason is very simple.
By default, rspec_autotest the loading path and does not take into
account the issue of naming space, so it is necessary to be loaded
their own.
There are two ways:
First, edit documents in the corresponding Spec loading path
require File.dirname(FILE) + ‘/…/…/spec_helper’ ### here
Another, add the overall load
require File.expand_path(File.dirname(FILE) +
“/…/spec/spec_helper”)
Two methods are very useful, but first some trouble.Choose your own
ways to use it
–
Best Wish For You
Raecoo
GTalk/Gmail: [email protected]
MSN: [email protected]