# Viewing html rendered during a test

**URL:** <https://www.ruby-forum.com/t/viewing-html-rendered-during-a-test/179850>\
**Category:** Rails\
**Created:** [December 5, 2009, 7:47am UTC](https://www.ruby-forum.com/t/viewing-html-rendered-during-a-test/179850 "2009-12-05T07:47:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![scudco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@scudco](https://www.ruby-forum.com/u/scudco)\
**Post date:** [December 5, 2009, 7:47am UTC](https://www.ruby-forum.com/t/viewing-html-rendered-during-a-test/179850/1 "2009-12-05T07:47:35Z")

</div>

Is it possible to view the html rendered in a test?

Im testing an assert\_select and its not passing though in the broswer  
all is fine.  
The test tells me what the assert\_select expected but id like to see  
what was there to make it fail. That way i can fix my code.

---

<div class="post-metadata">

**Author:** ![scudco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@scudco](https://www.ruby-forum.com/u/scudco)\
**Post date:** [December 5, 2009, 8:18am UTC](https://www.ruby-forum.com/t/viewing-html-rendered-during-a-test/179850/2 "2009-12-05T08:18:27Z")

</div>

Adam A. wrote:

> Is it possible to view the html rendered in a test?
> 
> Im testing an assert\_select and its not passing though in the broswer  
> all is fine.  
> The test tells me what the assert\_select expected but id like to see  
> what was there to make it fail. That way i can fix my code.

You should just be able to dump response.body to get the HTML.

Best,  
–Â  
MarnenÂ Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![scudco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/aca169/32.png) [@scudco](https://www.ruby-forum.com/u/scudco)\
**Post date:** [December 5, 2009, 9:11am UTC](https://www.ruby-forum.com/t/viewing-html-rendered-during-a-test/179850/3 "2009-12-05T09:11:08Z")

</div>

thanks for your reply. Im going to give that a whirl now.

adam
