R – the best way to test authlogic-open-id with cucumber and webrat

authlogiccucumberopenidrubyruby-on-rails

I've been having trouble using cucumber and webrat to test authlogic-openid authentication in a rails app. Following Ryan Bates's excellent screencast I was able to install authlogic with the open-id plugin. OpenID works when I login using the browser but so far I've been unable to test the app using cucumber and webrat.

I've tried using rots as a dummy open id server. Again this works when I try it in the browser but webrat won't doesn't correctly follow the get/post redirects required to authentic with the dummy open id server.

This answer on SO suggests overriding the authentication method to always return a successful login but this approach doesn't seem like integration testing the application.

What is the best way to functionally test authlogic-open-id? Should I even bother? Should I test the actions when the user is already logged in and assume OpenID will work?

Best Answer

have you tried the test helper set_session_for(@user)? I would assume that the plugin is tested and there really is no need to test it again (unless you have modified it).

Related Topic