Skip to content

Instantly share code, notes, and snippets.

@troelskn
troelskn / test.rb
Created February 27, 2013 11:03
Mock out sessions with Rack::Test
require File.join(File.dirname(__FILE__), 'test_helper.rb')
class AppTest < Test::Unit::TestCase
def test_get_root_path
current_session.rack_session[:user_id] = "1337"
get "/"
assert last_response.ok?
end
end