Sorry, I can't really say much beyond "It works for me".   The testing
branch of agility-gitorial uses capybara to log in successfully.
Maybe you can take a look at that to see what it's doing differently
from your app.

https://github.com/Hobo/agility-gitorial/tree/testing

The other thing to try is to use selenium with capybara -- seeing what
it's doing in a browser often helps pinpoint the issues.   Once it
works in the browser you can switch back to webrat.

cheers,
Bryan


On Thu, Jan 12, 2012 at 1:31 PM, Jim Harvey <[email protected]> wrote:
> I'm having trouble logging in to my application with a dummy user using
> capybara. I'm getting an "infinite redirect" error so I'm wondering if Hobo
> is somehow not creating the session after "clicking" the login button in my
> test. Here is the error:
>
> Failure/Error: click_button 'Login'
>      Capybara::InfiniteRedirectError:
>        redirected more than 5 times, check for infinite redirects.
>      # (eval):2:in `click_button'
>      # ./spec/requests/home_page_spec.rb:14:in `block (3 levels) in <top
> (required)>
>
> The test.log shows that the redirect is going back and forth between:
>
> Started GET "/login" for 127.0.0.1 at 2012-01-12 10:26:27 -0800
>   Processing by UsersController#login as HTML
> and
> Started GET "/" for 127.0.0.1 at 2012-01-12 10:26:27 -0800
>   Processing by FrontController#index as HTML
>
> and here my test, if it helps:
> describe "..." do
>     it "...etc etc... " do
>       visit user_login_path
>       fill_in 'login', :with => @user.email_address
>       fill_in 'password', :with => "Please"
>       click_button 'Login'
>       page.should_not have_content("...")
>     end
>   end
>
> Let me know if you need more code/info. This one is really confounding me...
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Hobo Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/hobousers/-/9UHoD6YapYwJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/hobousers?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to