Forum: Ruby on Rails Functional testing - why can you use session[:key] but not s

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.
Pat M. (Guest)
on 2006-02-10 10:12
(Received via mailing list)
Question's all in the title..

def test_foo
  assert_equal 'foo', session[:bar]  # Perfectly valid

def test_blowup
  session[:bar] = foo # TypeError: Symbol as array index

I always create a @session variable in the setup method.  Just curious
as to why you can get session values but not set them using session[]

This topic is locked and can not be replied to.