In a Rails application, *_spec.rb
files get special treatment depending on the file's directory. E.g. when you put a spec in spec/controllers
your examples will have some magic context like controller
, post
or get
that appears out of nowhere.
If you want that magic context for a spec in another folder, use the :type
option:
describe CakesController, :type => :controller do
...
end
Posted by Henning Koch to makandra dev (2012-10-17 12:54)