# Testing actions which render nothing

**URL:** <https://www.ruby-forum.com/t/testing-actions-which-render-nothing/135514>\
**Category:** Rails\
**Created:** [April 22, 2008, 7:47pm UTC](https://www.ruby-forum.com/t/testing-actions-which-render-nothing/135514 "2008-04-22T19:47:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/4af34b/32.png) [@adam](https://www.ruby-forum.com/u/adam)\
**Post date:** [April 22, 2008, 7:47pm UTC](https://www.ruby-forum.com/t/testing-actions-which-render-nothing/135514/1 "2008-04-22T19:47:42Z")

</div>

Hi all,

I’m trying to write a functional test for an action which does not  
render a template (calls render :nothing =\> true). When I run the test  
it raises a “Missing Template” error. I’m a bit confused by this as I  
don’t think it should be trying to render any template, and the action  
works without errors when manually tested. Any ideas how to fix this?

Many thanks

---

<div class="post-metadata">

**Author:** ![adam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/4af34b/32.png) [@adam](https://www.ruby-forum.com/u/adam)\
**Post date:** [April 22, 2008, 8:10pm UTC](https://www.ruby-forum.com/t/testing-actions-which-render-nothing/135514/2 "2008-04-22T20:10:06Z")

</div>

On Tue, Apr 22, 2008 at 1:47 PM, Adam [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi all,
> 
> I’m trying to write a functional test for an action which does not  
> render a template (calls render :nothing =\> true). When I run the test  
> it raises a “Missing Template” error. I’m a bit confused by this as I  
> don’t think it should be trying to render any template, and the action  
> works without errors when manually tested. Any ideas how to fix this?
> 
> Many thanks

It’s always worked fine for me. In my tests I also put a test that  
template == nil.

If you’re getting a Missing Template error, you sure you’re looking at  
the right action?

Jason

---

<div class="post-metadata">

**Author:** ![adam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/4af34b/32.png) [@adam](https://www.ruby-forum.com/u/adam)\
**Post date:** [April 22, 2008, 8:58pm UTC](https://www.ruby-forum.com/t/testing-actions-which-render-nothing/135514/3 "2008-04-22T20:58:45Z")

</div>

Yep. If only it were that easy! 🙂 I’m probably doing something silly,  
I’ll keep trying…
