# Acceptance test content is present on page

**URL:** <https://meta.discourse.org/t/acceptance-test-content-is-present-on-page/57292>\
**Category:** Development\
**Created:** [February 13, 2017, 2:48am UTC](https://meta.discourse.org/t/acceptance-test-content-is-present-on-page/57292 "2017-02-13T02:48:10Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)\
**Post date:** [February 13, 2017, 4:41am UTC](https://meta.discourse.org/t/acceptance-test-content-is-present-on-page/57292/4 "2017-02-13T04:41:59Z")

</div>

Ah, yeah, you don’t want to use `find()` when dealing with `:contains`, you will want to use `exists()`

Example of it at  
[https://github.com/discourse/discourse/blob/master/test/javascripts/acceptance/search-full-test.js.es6#L274-L287](https://github.com/discourse/discourse/blob/master/test/javascripts/acceptance/search-full-test.js.es6#L274-L287)

IIRC, that is because `find()` will still return an empty object back and should be used with `assert.equal` so you can compare a specific attribute of what you expected to find to an expectation.

`exists` will handle that object being empty and treat it as “not found” or “false”  
[https://github.com/discourse/discourse/blob/master/test/javascripts/helpers/assertions.js#L3-L5](https://github.com/discourse/discourse/blob/master/test/javascripts/helpers/assertions.js#L3-L5)

---

_[View the full topic](https://meta.discourse.org/t/acceptance-test-content-is-present-on-page/57292)._
