Forum: Ruby on Rails Rails 2.2 Integration tests cookie store

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Darren (Guest)
on 2008-11-23 01:07
(Received via mailing list)
I've upgraded an existing application from 2.1 to 2.2.2.  All of the
integration tests failed, complaining about there being no 'secret'
defined in the session_store configuration options.  There isn't a
secret defined, since we don't use the cookie session store (it's a
wap site, and many phone browsers don't support cookies).  Setting the
secret to an appropriate value fixed all the tests.

It looks like the database_manager is hardcoded to be a CookieStore in

Is there any plan on getting integration tests to use the actual
configured cookie store?  Or should we be finding a better way to do
higher level integration tests?

Lee F. (Guest)
on 2008-12-10 00:45
(Received via mailing list)
What I ended up doing was overriding the default options in

In test.rb, I added

class ActionController::RackRequest
    :database_manager => CGI::Session::MemoryStore, # store data in
    :prefix           => "ruby_sess.",    # prefix session file names
    :session_path     => "/",             # available to all paths in
    :session_key      => "_session_id",
    :cookie_only      => false,
    :session_http_only=> true

I get a warning about the constant already being defined, but it's
better than having the tests fail.

Also see <

Zaphod B. (Guest)
on 2009-01-21 11:20
(Received via mailing list)
Someone to give me the configuration for
"config.action_controller.session_store = :active_record_store" ?!

Zaphod B. (Guest)
on 2009-02-03 10:16
(Received via mailing list)
Ok the good configuration for Session store une database by
ActiveRecord is :

  class ActionController::RackRequest
      :database_manager => CGI::Session::ActiveRecordStore,
      :cookie_only      => false,
      :session_http_only=> true

Add this code in integration test.
This topic is locked and can not be replied to.