I’ve been doing my plugin and testing it with rspec. Let me show the
spec code first: http://pastie.org/249050
So, this spec lies in vendor/plugins/myplugin/spec/lib
The reason I set @controller, @request and @response in before(:all)
is because rspec complains they are not set (probably because I run
this test from plugin dir). Anyway, the error pops up on str 21, when
it tries to execute redirect_to(): undefined local variable or method
`request’. I’ve checked redirect_to source and I have no idea how to
pass it the ‘request’ variable.
Probably, the whole thing happens because I forgot to require/include
something (that’s why I have to set @controllers and others manually).
I wish it could just work as when it’s run from RAILS_ROOT/spec.
Any help or ideas, please?