#196 awaiting-merge
Ben Woosley

LabelLocator misses Labels with nested Fields and no space seperating the two

Reported by Ben Woosley | March 13th, 2009 @ 10:16 PM

Currently, LabelLocator will detect the label here:

Label Text <any-field-tag>Field Text</any-field-text>

But not here:

Label Text<any-field-tag>Field Text</any-field-text>

Because inner_html pulls the text out like so:

"Label TextField Text"

I fix this by removing nested fields before attempting to match.

See my commits here: http://github.com/pivotal/webrat... http://github.com/pivotal/webrat... http://github.com/pivotal/webrat... http://github.com/pivotal/webrat...

plus minor cleanup: http://github.com/pivotal/webrat...

Comments and changes to this ticket

  • Ben Woosley

    Ben Woosley March 13th, 2009 @ 10:19 PM

    Let's try this again:

    Currently, LabelLocator will detect the label here:

    <label>Label Text <any-field-tag>Field Text</any-field-text><label>

    But not here:

    <label>Label Text<any-field-tag>Field Text</any-field-text><label>

  • Ben Woosley

    Ben Woosley March 14th, 2009 @ 11:17 AM

    A couple of problems with my changes, as they are:

    • It only removes first-level child fields, so it wouldn't catch: <label>Label Text<p><any-field-tag>Field Text</any-field-text><p><label>
    • The iteration and removal should be done with webrat/xml helpers for compatibility with rexml
  • Ben Woosley

    Ben Woosley March 17th, 2009 @ 10:43 PM

    Finished this up and condensed it into the attached patch. You can see the development process here: http://github.com/pivotal/webrat...

  • gaffo

    gaffo May 7th, 2009 @ 05:25 PM

    • State changed from “new” to “awaiting-merge”

    Good sized patch, needs to be further verified. But looks interesting.

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