[rspec-users] Controller specs and Middleware on Rails

Román González romanandreg at gmail.com
Tue Feb 9 14:01:11 EST 2010


Hey guys,

I'm having some problems on my controller specs regarding authentication.
Previously I was using restful_authentication on the project, but after a
major refactoring we changed the authentication code to "Warden":
http://github.com/hassox/warden (Rack Middleware authentication).

When the controller specs are executed, they fail because there is not a
variable on the request's env set by the Warden middleware. I've read on a
previous message that I probably should use an integration test in order to
tests this, I used cucumber and test everything successfully. However all my
legacy rspec controller tests (that depended on a current_user) are now
failing.

Is there a way to patch the rSpec controller API to include this middleware
on each test request?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100209/5c5e2ae5/attachment.html>


More information about the rspec-users mailing list