Could someone point me to a reference that explains how I would test
the order of elements on an HTML page?

For example, in RSpec I would like to verify that the content of one
<p> element appears before the content of another.

response.should have_selector("p", :content => "Should appear first")
response.should have_selector("p", :content => "Should appear second")

The two lines above test that the 2 contents appear, but I don't know
how to test that the first content appears before the second.

Thanks

Mike

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Dave Aronson at Mar 5, 2012 at 10:34 pm

    On Wed, Feb 29, 2012 at 23:28, Mike Kim wrote:

    Could someone point me to a reference that explains how I would test
    the order of elements on an HTML page?
    Maybe use a regexp that has one and then the other, with .* between
    them? Or find them, and make sure the indexes are in the right order?

    -Dave

    --
    Dave Aronson:  Available Cleared Ruby on Rails Freelancer
    (NoVa/DC/Remote) -- see www.DaveAronson.com, and blogs at
    www.Codosaur.us, www.Dare2XL.com, www.RecruitingRants.com

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedMar 1, '12 at 4:28a
activeMar 5, '12 at 10:34p
posts2
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Mike Kim: 1 post Dave Aronson: 1 post

People

Translate

site design / logo © 2021 Grokbase