Well, I was having problems with my tests where:
get :my_method, :other_params
Just wasn’t seeming to trigger my method. When I ran “rake
spec:controllers” it turns out that Radiant’s site_controller_spec.rb
would fail all over the place too – errors tied to checking the
response (success expected but was fail, etc).This would happen even if
I didn’t declare any methods – just mixed in the code. Remove the
include line from the extension_name.rb file and all was well.
Since I’m writing this extension BDD style, I didn’t even bother to fire
up a server (I don’t have any views yet anyway) so I don’t know if this
would have run fine and that the errors might just be a testing setup
thing… As I mentioned originally, perhaps this is a case of the rSpec
mixins fighting with mine.
My other thought was that possibly something special was needed to
properly declare the controller and response objects – that rSpec
wasn’t doing it’s magic just right given my spec name or something. (in
fact, I wound up moving my spec to
/specs/controllers/site_controller_mods.rb to get some of the tests to
Anyway, since then, I altered my approach to allow me to create my own
controller that inherits from SiteController so my problems have gone
away on their own. I would love to know what was up here, though.