views:

126

answers:

1

I'm trying out capybara with cucumber to get some better javascript test coverage. I have a lot of steps that check or use things from the Rails integration test helpers, for instance:

assigns(:current_user).should_not be_nil

No matter how I call assigns, even if I say something like p assigns it errors with:

undefined method `template' for nil:NilClass (NoMethodError)

So, it seems that I can't do that anymore. Is there an alternative to introspecting what's going on in the controller, or maybe some way of at least running those steps in such a way that I have the integration test stuff back?

A: 

Unfortunately there isn't. Capybara tests rack apps, and has no way of communicating with what's inside that rack app other than through the standard rack interface (i.e. issueing HTTP requests). Anything that happens inside the rack app is invisible to Capybara.

jnicklas