Skip to content

Instantly share code, notes, and snippets.

@ozgun

ozgun/my_app_spec.rb

Created May 31, 2011
Embed
What would you like to do?
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