Setting and testing session data within a test

Hi everyone,

One of my actions depends on some session data being set. When I try
to set the data in a test case, I get an error.

session[:conditions] = [ “LOWER(username) LIKE :bad_name”,
{ :bad_name => “asdasdasd” } ]

TypeError: Symbol as array index
test/functional/personnel_controller_test.rb:43:in `[]=’

How can I set session data in a test?

In normal use, the data is set in one action, which then redirects to
another action. Can I test 2 actions? Work with one action,
redirect_to the other, and then test the resulting page?



This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs