문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top