The key thing that I never saw spelled out about XPath was that you can
have more than one conditional (e.g. [id()='foo'][text()*='bar]). Once I
understood that, it was fairly easy to work with.

Shalon Wood

MarkMT <[email protected]> writes:

> Thanks Shalon. I think I can see how that would work (though haven't
> used have_xpath before). A have_tag solution would still be nice
> (syntax just seems a little less arcane), but I'll take a closer look
> at the xpath approach.
>
> Mark.
>
>
> On Jan 26, 8:07 am, Shalon Wood <[email protected]> wrote:
>> MarkMT <[email protected]> writes:
>> > Can someone give me some advice about how to test for a merb view that
>> > contains something like -
>>
>> > <div id="some_id">
>> >     some_text <a href="http://example.com";>some_more_text</a>
>> > </div>
>>
>> > I know that rspec when used with rails allows you to write something
>> > like -
>>
>> > response.should have_tag('div#some_id', 'some_text')
>>
>> response.should have_xpath("//div[id()='some_id'][text()*='some_text']")
>> should do it, off the top of my head.
>>
>> Shalon Wood
> >
>

-- 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to