Skip to content

Instantly share code, notes, and snippets.

@ozgun
Created May 31, 2011 08:57
Show Gist options
  • Save ozgun/1000196 to your computer and use it in GitHub Desktop.
Save ozgun/1000196 to your computer and use it in GitHub Desktop.
sinatra-testing-with-sessions
it "tests something..." do
sess = {'warden.user.user.key' => [User, User.first.id]}
encoded = [Marshal.dump(sess)].pack("m*")
get "/testing", {}, {'HTTP_COOKIE' => "rack.session=" + encoded}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment