# Trouble testing for page element

**URL:** <https://www.ruby-forum.com/t/trouble-testing-for-page-element/128749>\
**Category:** Rails\
**Created:** [February 11, 2008, 9:09am UTC](https://www.ruby-forum.com/t/trouble-testing-for-page-element/128749 "2008-02-11T09:09:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dracos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ea666f/32.png) [@dracos](https://www.ruby-forum.com/u/dracos)\
**Post date:** [February 11, 2008, 9:09am UTC](https://www.ruby-forum.com/t/trouble-testing-for-page-element/128749/1 "2008-02-11T09:09:35Z")

</div>

I’m trying to use Luke R.'s hpricot\_test\_helper plugin to test for  
the existence of a page element in my integration test. I get errors  
like “nil.content\_for” for even when using examples copied directly from  
his tutorial which indicate that the @output variable in  
hpricot\_test\_helper is coming up nil:

def tag(css\_query)  
@output.content\_for(css\_query)  
end

I thought the plugin be configured to receive html output upon  
installation via hpricot. Am I mistaken?

Also, are people still using this? At 18th months old it’s somewhat  
dated by rails standards. Is there something later and greater I should  
be using?

Thanks,

Peter
