#181 open
lvenegas (at gmail)

Error in link_locator under JRuby

Reported by lvenegas (at gmail) | March 2nd, 2009 @ 01:38 AM

Under JRuby (maybe under MRI also??) when running a cucumber feature that makes use of the click_link method an error is thrown as follows:

And I follow 'Forgot your Member Id or password?' You have a nil object when you didn't expect it! The error occurred while evaluating nil.gsub (NoMethodError) (eval):2:in click_link' features/step_definitions/webrat_steps.rb:10 features/plain/member_login.feature:97:inAnd I follow 'Forgot your Member Id or password?''

I tracked down the error to the file lib/webrat/core/locators/link_locator.rb

The method causing the issue is:

def replace_nbsp_ref(str) str.gsub(' ',' ').gsub(' ', ' ') end

Adding an if statement to check for nil fixes it.

def replace_nbsp_ref(str) str.gsub(' ',' ').gsub(' ', ' ') if str end

Thanks

Leo

Comments and changes to this ticket

  • gaffo

    gaffo May 7th, 2009 @ 04:09 PM

    • Tag changed from click_link, jruby to click_link, jruby, verify
    • State changed from “new” to “open”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Ruby Acceptance Testing for Web applications.

Shared Ticket Bins

People watching this ticket

Pages