views:

2399

answers:

2

trying to use authlogic's test helpers. calling activate_authlogic.

Our application_controller has a current_user_session method.

when we drop into the debugger mid-story, controller returns a Authlogic::TestCase::MockController

but when we call controller.current_user_session

The error occurred while evaluating nil.current_user_session

How does this mock suddenly become a nil?

And does this mock controller know about our application controllers' code?

A: 

I don't know authlogic (and if this answer is helpful at all), but where does that mock object come from in the first place? You shouldn't be using any mocks in you cucumber stories. Cucumber is like an integration test, testing the complete Rails Stack.

I use it, to make sure, that my view, controller and model specs haven't diverged from each other.

jcfischer
+5  A: 

See this question.

Waseem