Message from discussion
Steak with Session Example
Received: by 10.142.241.17 with SMTP id o17mr798999wfh.41.1298495002955;
Wed, 23 Feb 2011 13:03:22 -0800 (PST)
X-BeenThere: steakrb@googlegroups.com
Received: by 10.142.201.17 with SMTP id y17ls998131wff.1.p; Wed, 23 Feb 2011
13:03:22 -0800 (PST)
MIME-Version: 1.0
Received: by 10.142.200.14 with SMTP id x14mr271641wff.33.1298495002011; Wed,
23 Feb 2011 13:03:22 -0800 (PST)
Received: by a11g2000pro.googlegroups.com with HTTP; Wed, 23 Feb 2011 13:03:21
-0800 (PST)
Date: Wed, 23 Feb 2011 13:03:21 -0800 (PST)
In-Reply-To: <73a0c849-a2eb-42a3-bd7a-8cd85d15297d@y31g2000prd.googlegroups.com>
X-IP: 75.25.153.114
References: <12228459.494.1298433194013.JavaMail.geo-discussion-forums@prof15>
<AANLkTi=gEJ65BVx20817fc5Z5bRbSdihMffoQDPkQk=c@mail.gmail.com> <73a0c849-a2eb-42a3-bd7a-8cd85d15297d@y31g2000prd.googlegroups.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-US)
AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.102 Safari/534.13,gzip(gfe)
Message-ID: <7fe5fc32-0e12-400f-a015-8ffb73c23125@a11g2000pro.googlegroups.com>
Subject: Re: Steak with Session Example
From: Tanner Donovan <ttdono...@gmail.com>
To: Steak <steakrb@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
After further investigation I think my issue might be with routes and
SSL. The Rails app is using the 'ssl_requirement' plugin. Watching the
log/test.log file more closely I see:
Processing ApplicationController#redirect_to_root_url (for 127.0.0.1
at 2011-02-23 12:42:33) [GET]
Parameters: {"url"=3D>["account", "session"],
"action"=3D>"redirect_to_root_url", "controller"=3D>"application"}
Redirected to http://www.example.com/account/session
Filter chain halted as [:ensure_proper_protocol]
rendered_or_redirected.
Completed in 1ms (DB: 0) | 302 Found [https://www.example.com/account/
session]
routes.rb includes:
map.namespace :account, :requirements =3D> {:protocol =3D>
ROUTES_PROTOCOL} do |a|
a.resource :session, :controller =3D> 'sessions', :only =3D> :create
a.resource :profile, :controller =3D> 'profiles', :only =3D> :show
end
rake routes shows:
account_session POST /account/session(.:format)
{:action=3D>"create", :protocol=3D>"https", :controller=3D>"account/
sessions"}
Anyone have suggestions how I can ensure my Capybara::Session is using
SSL?
On Feb 23, 12:26=A0pm, Tanner Donovan <ttdono...@gmail.com> wrote:
> The scenario is failing at expected: "/account", got: "/" (using =3D=3D).
> I'm trying to use ruby-debug to step through the scenario and
> inspecting the page (Capybara::Session) object and use Rails logger,
> but my controller's logger.info is not showing up in the log/test.log.
> Any suggestions on how I can capture logger messaging from within the
> Rails app?
>
> Tanner
>
> On Feb 23, 5:07=A0am, Jaime Iniesta <jaimeinie...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi Tanner, what's exactly the problem you're facing?
>
> > I have a similar setup and I do just like you, visit the sign in form,
> > fill it and click the button. No special setup needed.
>
> > 2011/2/23 Tanner Donovan <ttdono...@gmail.com>:
>
> > > Maybe this is more a Capybara question, but I am wondering if someone=
could
> > > provide me with an example of using Steak with sessions. I'm
> > > trying=A0achieve=A0something like=A0https://gist.github.com/839970=A0=
which tests a
> > > user sign in form into a protected area. Thanks in advance.
>
> > --
> > Jaime Iniesta, freelance web developerhttp://jaimeiniesta.comhttp://pro=