What I what to accomplish is to use (rely on) current_user method while defining Cucumber steps. I’m using Clearance in my project.
First of all I tried to use sign_in but it didn’t work (I guess Cucumber World doesn’t know about Clearance methods…).
So how do I make Cuckes recognize current_user and sign_in/sign_out methods?
Your Cucumber features should be driving your application through the public user interface. Something like:
Since the
current_usermethod isn’t available to the browser, you shouldn’t be using it in your spec.You could fake it in your steps by storing
@current_userin the above step and then providing an attribute reader for it.