Martin DeMello
2006-Nov-04 02:03 UTC
[Rails] test/controller not using activerecord session
I''m using zentest and the test::rails class to do my controller testing, and the following line in my controller throws an error: session.model.user_id = user.id It looks like session is just a hash when testing, which would be well and good except that now I have to write if session.respond_to?(:model) session.model.user_id = user.id end which doesn''t feel right to me (actual code shouldn''t have to be modified to keep the test suite happy). Any way to make the test environment use db sessions? martin
Reasonably Related Threads
- Caching::Sweeper Access to Controller
- acts_as_taggable: weird SQL problem with untagging
- How to save the user_id in a separate column when using ActiveRecord::SessionStore?
- Functional Test has error when testing controller updates_attribute of its parrent.
- invalidating a session on multiple login