From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.141.43.5 with SMTP id v5cs142588rvj; Mon, 8 Feb 2010 23:07:08 -0800 (PST) Received-SPF: pass (google.com: domain of 3mglxSwgJCmAKGQX8aaaEK8GJ.AMKP8AI-BCTCJEMMEJCEPMSNQ.AMK@groups.bounces.google.com designates 10.101.180.32 as permitted sender) client-ip=10.101.180.32; Authentication-Results: mr.google.com; spf=pass (google.com: domain of 3mglxSwgJCmAKGQX8aaaEK8GJ.AMKP8AI-BCTCJEMMEJCEPMSNQ.AMK@groups.bounces.google.com designates 10.101.180.32 as permitted sender) smtp.mail=3mglxSwgJCmAKGQX8aaaEK8GJ.AMKP8AI-BCTCJEMMEJCEPMSNQ.AMK@groups.bounces.google.com; dkim=pass header.i=3mglxSwgJCmAKGQX8aaaEK8GJ.AMKP8AI-BCTCJEMMEJCEPMSNQ.AMK@groups.bounces.google.com Received: from mr.google.com ([10.101.180.32]) by 10.101.180.32 with SMTP id h32mr1708286anp.37.1265699227830 (num_hops = 1); Mon, 08 Feb 2010 23:07:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:x-beenthere:received:received:received :received:received-spf:received:mime-version:received:date:x-ip :user-agent:x-http-useragent:message-id:subject:from:to :x-original-authentication-results:x-original-sender:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :x-thread-url:x-message-url:sender:list-subscribe:list-unsubscribe :content-type; bh=Gb69U/E/gi+GJep8QrCuBPigeKFMJuMUcrj79PT7LT0=; b=iV9aOZnub5po/3HGaqMdkyX9L9+eLfQpJHdtxo7+IshivtGcD/8MyZHoYCXt6tvliv 0q8lMQiFszkEd/N9N6bOw/oodrxXwwz6HMOf/Ev9r67MHasNhZQucbidg9Tc9h5KvEKu b1awLe2tLI2Ukf5XgwqaGbIH99PraX5rbmgcU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-beenthere:received-spf:mime-version:date:x-ip:user-agent :x-http-useragent:message-id:subject:from:to :x-original-authentication-results:x-original-sender:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :x-thread-url:x-message-url:sender:list-subscribe:list-unsubscribe :content-type; b=Gf0kIvMXc8YvmnoXNwl3owGl0GtSqq5UWQAcyovT/STQ4gc0haXfSsmRonwifHjuDV 9HvCanr9IHYbjIrW03moULUP5OxDh//nxGNvEVK2IHtElqHuoYNjHkmKc/5Zqf3wR8Nn TFMUOVDbtaaqu8JQlLwkYLJ9IWHW0BmWeZtHU= Received: by 10.101.180.32 with SMTP id h32mr138014anp.37.1265699226594; Mon, 08 Feb 2010 23:07:06 -0800 (PST) X-BeenThere: rack-devel@googlegroups.com Received: by 10.91.26.32 with SMTP id d32ls32947agj.1.p; Mon, 08 Feb 2010 23:07:05 -0800 (PST) Received: by 10.91.148.11 with SMTP id a11mr8497823ago.9.1265699225442; Mon, 08 Feb 2010 23:07:05 -0800 (PST) Received: by 10.91.148.11 with SMTP id a11mr8497821ago.9.1265699225392; Mon, 08 Feb 2010 23:07:05 -0800 (PST) Return-Path: Received: from mail-yw0-f148.google.com (mail-yw0-f148.google.com [209.85.211.148]) by gmr-mx.google.com with ESMTP id 25si582395yxe.1.2010.02.08.23.07.05; Mon, 08 Feb 2010 23:07:05 -0800 (PST) Received-SPF: pass (google.com: domain of misza222@gmail.com designates 209.85.211.148 as permitted sender) client-ip=209.85.211.148; Received: by ywh12 with SMTP id 12so23687721ywh.19 for ; Mon, 08 Feb 2010 23:07:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.101.176.29 with SMTP id d29mr134574anp.0.1265699225340; Mon, 08 Feb 2010 23:07:05 -0800 (PST) Date: Mon, 8 Feb 2010 23:07:05 -0800 (PST) X-IP: 82.71.41.52 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.0.17) Gecko/2010010604 Ubuntu/9.04 (jaunty) Firefox/3.0.17,gzip(gfe),gzip(gfe) Message-ID: <5b745a22-187a-457c-ab05-9856bd5eaaf4@u26g2000yqm.googlegroups.com> Subject: Setting session from tests From: misza222 To: Rack Development X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of misza222@gmail.com designates 209.85.211.148 as permitted sender) smtp.mail=misza222@gmail.com X-Original-Sender: misza222@gmail.com Reply-To: rack-devel@googlegroups.com Precedence: list Mailing-list: list rack-devel@googlegroups.com; contact rack-devel+owners@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: X-Thread-Url: http://groups.google.com/group/rack-devel/t/ebd78f71ba7eb0b0 X-Message-Url: http://groups.google.com/group/rack-devel/msg/abdc48adbc23bb4d Sender: rack-devel@googlegroups.com List-Subscribe: , List-Unsubscribe: , Content-Type: text/plain; charset=ISO-8859-1 Hi, How to set a session from within the tests? I am using Rack::Test to test user authorization mechanism. I need to make sure that user is redirected to the 'return_to' path which is stored in a session. post '/login', { :'user[email]' => @user.email, :'user[password]' => @user.password } I tried creating mock request like Rack::MockRequest.env_for("/login", {:"rack.session" => {:return_to => '/return_to'}}) and appending it as a 3rd parameter to the post method but no luck. It was rather hit and miss approach as I don't really know how env is organized :/ Can anyone help? Cheers, Michal