Setting and testing session data within a test


#1

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.

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

Error:
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?

Thanks,

Sean