[rspec-devel] [ rspec-Bugs-8887 ] Should have RJS matches DOM IDs as substrings

noreply at rubyforge.org noreply at rubyforge.org
Mon Feb 26 10:13:07 EST 2007


Bugs item #8887, was opened at 2007-02-26 15:13
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=8887&group_id=797

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Ashley Moran (ashley_moran)
Assigned to: Nobody (None)
Summary: Should have RJS matches DOM IDs as substrings

Initial Comment:
In RSpec 0.7.5.1, given:
    <div id="my_div" />

and RJS to insert a partial at the bottom of the div, the following spec passes:
    response.should_have_rjs :insert_html, :bottom, "my_div"

but so does this:
    response.should_have_rjs :insert_html, :bottom, "y_di"

because the string "y_di" is a substring of the ID.


Is this intended?  To create robust specs, you need to do this:
  response.should_have_rjs :insert_html, :bottom, /^my_div$/

which seems unintuitive.

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=8887&group_id=797


More information about the rspec-devel mailing list