How to test OpenID in rails with cucumber. Does anybody have real example? For example by using Fakeweb. Thank's
I assume you don't want to test against a real OpenID provider so you'd probably need to create a fake of some sort. Or maybe stub the OpenID mechanism so that you can choose the execution path through your code by having it return different canned responses for different tests.
In terms of using Cucumber with Rails, Webrat is considered the standard way of faking a request through the web stack - it is pretty powerful and results in nice readable step definitions. Take a look at these links for further details:
- http://github.com/brynary/webrat - look at the readme at the bottom of the project page
- http://wiki.github.com/brynary/webrat/ - some further details on the webrat github wiki
I found this blog post that explains how to use Ruby OpenID Test Server (ROTS) as a local open id server for running integration tests against.
There is also a related question - How do I fake OpenID login in RSpec user story/Cucumber when using open_id_authentication plugin