Colin Law wrote:
> I have the following html
> <p><b>text</b>value</p>
> I can use
> assert_select "p>b", "text"
> to check the text portion, and
> assert_select "p", "value"
> to check that the value appears in a <p>.  I cannot work out how to
> check that the two are in the same <p>.  I have used assert_select for
> much more complex tasks but my mind seems to have gone blank and
> google has not provided an example of this type.
> 
> Any help would be much appreciated.

First off: you shouldn't ever be using <b> tags.  That's 1990s physical 
styling.  That's *bad*.  You should be using a semantically named <span> 
instead.  But you probably knew that already.

Now to your question...I think I'd use assert_select 'p', :html => 
'<b>text</b>value'.  Does that help?

> 
> Colin

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org
-- 
Posted via http://www.ruby-forum.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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to