Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Errors with click_button with the default driver (works fine with Selenium) after upgrading to Rails 2.3.6
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Cássio Marques  
View profile  
 More options May 23 2010, 11:18 am
From: Cássio Marques <cassio...@gmail.com>
Date: Sun, 23 May 2010 07:18:11 -0800
Local: Sun, May 23 2010 11:18 am
Subject: [Capybara] Errors with click_button with the default driver (works fine with Selenium) after upgrading to Rails 2.3.6

Hi folks,

In every step definition where I have a click_button call I'm getting the
following error:

undefined method `downcase' for nil:NilClass (NoMethodError)

It happens only in non-JS scenarios. For the scenarios where I use Selenium
everything is fine.

I did a quick search through the Capybara code base but could not find the
origin of this error... if someone could point it to me I can try to patch
it.

Thanks!

--
Cássio Marques

Blog: http://cassiomarques.wordpress.com

If you're writing code and you're not testing it, the code is wrong. I don't
care if it does the right thing, and people need to understand this. If it
works by accident, you're still wrong.
Bryan Liles - Ruby Hoedown 2008


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel  
View profile  
 More options May 24 2010, 3:54 am
From: Daniel <daniel.gaiott...@gmail.com>
Date: Mon, 24 May 2010 00:54:47 -0700 (PDT)
Local: Mon, May 24 2010 3:54 am
Subject: [Capybara] Re: Errors with click_button with the default driver (works fine with Selenium) after upgrading to Rails 2.3.6
I've run into this error as well after upgrading to Rails 2.3.6. I
only get the error on the sign_out button on our app and I've followed
the problem into rack-test. Specifically it is the replaces?(other)
method in cookie_jar.rb where the error occurs since "name" is nil and
name.downcase causes the error.

def replaces?(other)
[name.downcase, domain, path] == [other.name.downcase, other.domain,
other.path]
      end

gems/rack-test-0.5.3/lib/rack/test/cookie_jar.rb:29:in `replaces?'

Since I only see the error on sign_out and sign_out is handled by
clearance (an old version too) my next step is to rip out clearance in
favor of devise to see if this solves the issue.

If you find another solution please share :)

- Daniel

On May 23, 5:18 pm, Cássio Marques <cassio...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Cássio Marques  
View profile  
 More options May 24 2010, 7:15 am
From: Cássio Marques <cassio...@gmail.com>
Date: Mon, 24 May 2010 03:15:04 -0800
Local: Mon, May 24 2010 7:15 am
Subject: Re: [Capybara] Re: Errors with click_button with the default driver (works fine with Selenium) after upgrading to Rails 2.3.6

Hum... now that you told me that I take a look here and all the failures
occur in sign in forms, using authlogic. I'll see if there's a newer version
of Authlogic that maybe is not causing that problem.

Thanks!

--
Cássio Marques

Blog: http://cassiomarques.wordpress.com

If you're writing code and you're not testing it, the code is wrong. I don't
care if it does the right thing, and people need to understand this. If it
works by accident, you're still wrong.
Bryan Liles - Ruby Hoedown 2008


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Łukasz Piestrzeniewicz  
View profile   Translate to Translated (View Original)
 More options May 25 2010, 3:14 am
From: Łukasz Piestrzeniewicz <bragi.ragnar...@gmail.com>
Date: Tue, 25 May 2010 00:14:23 -0700 (PDT)
Local: Tues, May 25 2010 3:14 am
Subject: [Capybara] Re: Errors with click_button with the default driver (works fine with Selenium) after upgrading to Rails 2.3.6
There seems to be a problem with Rack::Test or similar area. When
application sets more then one cookie headers seem to be joined by "\n
\n" instead of "\n" when Rack::Test::CookieJar tries to create cookies
from them. A quick fix is to put this in config/initializers/
rack_test_cookie_jar_fix.rb

require 'rack/test'
require 'rack/test/cookie_jar'

Rack::Test::CookieJar.class_eval do
  def merge(raw_cookies, uri = nil)
    return unless raw_cookies

    raw_cookies = raw_cookies.split("\n") if raw_cookies.is_a? String
    raw_cookies.reject! {|raw_cookie| raw_cookie.blank?}
    raw_cookies.each do |raw_cookie|
      cookie = ::Rack::Test::Cookie.new(raw_cookie, uri,
@default_host)
      self << cookie if cookie.valid?(uri)
    end
  end
end

Łukasz

On May 24, 1:15 pm, Cássio Marques <cassio...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Reilly  
View profile  
 More options May 26 2010, 12:29 pm
From: John Reilly <john.j.rei...@gmail.com>
Date: Wed, 26 May 2010 09:29:26 -0700 (PDT)
Local: Wed, May 26 2010 12:29 pm
Subject: Re: Errors with click_button with the default driver (works fine with Selenium) after upgrading to Rails 2.3.6
On May 25, 2:14 am, £ukasz Piestrzeniewicz <bragi.ragnar...@gmail.com>
wrote:

> There seems to be a problem with Rack::Test or similar area. When
> application sets more then one cookie headers seem to be joined by "\n
> \n" instead of "\n" when Rack::Test::CookieJar tries to create cookies
> from them.

I ran into this issue as well, and created a quick patch (plus test)
on my fork of the rack-test project:

http://github.com/johnreilly/rack-test/commit/045b99388049e0b846b932c...

Thanks for the help, £ukasz! :-)

-John


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Reilly  
View profile  
 More options May 27 2010, 11:57 am
From: John Reilly <john.j.rei...@gmail.com>
Date: Thu, 27 May 2010 08:57:09 -0700 (PDT)
Local: Thurs, May 27 2010 11:57 am
Subject: Re: Errors with click_button with the default driver (works fine with Selenium) after upgrading to Rails 2.3.6
On May 26, 11:29 am, John Reilly <john.j.rei...@gmail.com> wrote:

> I ran into this issue as well, and created a quick patch (plus test)
> on my fork of the rack-test project:

> http://github.com/johnreilly/rack-test/commit/045b99388049e0b846b932c...

Quick update: The patch was merged in, and a new version of the rack-
test gem (v0.5.4) was released that no longer has the "undefined
method `downcase' for nil:NilClass (NoMethodError)" problem.

I love the speed of open source! :)

-John
@johnreilly


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »