stringify_keys error after supplementing session variables in functional tests

天涯浪子 提交于 2019-12-07 16:33:36

try this to fix your error in Rails 3.1

  sign_in user
  hashy = session['warden.user.user.key'][2]
  get :action, nil, {"warden.user.user.key"=>["User", [user.id],hashy]}, nil

Worked for me. Seems to not like the new way Rails handles TestSessions.

I think you better do:

def valid_session
    my_session_values = {:some_key => :some_value}
    session.to_hash.merge my_session_values
end
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!