Ok the good configuration for Session store une database by
ActiveRecord is :

  class ActionController::RackRequest
    DEFAULT_SESSION_OPTIONS = {
      :database_manager => CGI::Session::ActiveRecordStore,
      :cookie_only      => false,
      :session_http_only=> true
    }
  end

Add this code in integration test.



On 20 jan, 15:59, Zaphod Beeblebrox <[email protected]> wrote:
> Someone to give me the configuration for
> "config.action_controller.session_store = :active_record_store" ?!
>
> Thanks.
>
> On 9 déc 2008, 21:49, Lee Fyock <[email protected]> wrote:
>
> > What I ended up doing was overriding the default options in
> > RackRequest.
>
> > In test.rb, I added
>
> > class ActionController::RackRequest
> >   DEFAULT_SESSION_OPTIONS = {
> >     :database_manager => CGI::Session::MemoryStore, # store data in
> > memory
> >     :prefix           => "ruby_sess.",    # prefix session file names
> >     :session_path     => "/",             # available to all paths in
> > app
> >     :session_key      => "_session_id",
> >     :cookie_only      => false,
> >     :session_http_only=> true
> >   }
> > end
>
> > I get a warning about the constant already being defined, but it's
> > better than having the tests fail.
>
> > Also see <http://rails.lighthouseapp.com/projects/8994/tickets/1453-
> > gets-in-integration-test-unless-you-are-using-cookie-sessions>.
>
> > Lee
>
> > On Nov 22, 5:51 pm, Darren <[email protected]> wrote:
>
> > > 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
> > > rack_process.rb.
>
> > > 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?
>
> > > Thanks,
> > > Darren
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to