# Testing rendered output

**URL:** <https://www.ruby-forum.com/t/testing-rendered-output/123582>\
**Category:** Rails\
**Created:** [December 18, 2007, 10:46pm UTC](https://www.ruby-forum.com/t/testing-rendered-output/123582 "2007-12-18T22:46:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![plambert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/9d8465/32.png) [@plambert](https://www.ruby-forum.com/u/plambert)\
**Post date:** [December 18, 2007, 10:46pm UTC](https://www.ruby-forum.com/t/testing-rendered-output/123582/1 "2007-12-18T22:46:54Z")

</div>

I would like to check that one of the methods in my controller  
produces the expected rendered output. The method in question just  
returns a JSON string, so it’s not like I’m trying to check a whole  
web page or something. Is there a way to get the rendered output  
somehow? I looked at the TestResponse methods (checking the source)  
and there didn’t seem to be anything useful there.

Thanks,  
–Paul

---

<div class="post-metadata">

**Author:** ![plambert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/9d8465/32.png) [@plambert](https://www.ruby-forum.com/u/plambert)\
**Post date:** [December 19, 2007, 2:30am UTC](https://www.ruby-forum.com/t/testing-rendered-output/123582/2 "2007-12-19T02:30:53Z")

</div>

On 12/18/07, Paul E. G. Lynch [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> –~–~---------~–~----~------------~-------~–~----~  
> response.body should let you get at the string.  
> –  
> Rick DeNatale

My blog on Ruby  
[http://talklikeaduck.denhaven2.com/](http://talklikeaduck.denhaven2.com/)
