# Testing: Application controller and helper

**URL:** <https://www.ruby-forum.com/t/testing-application-controller-and-helper/164752>\
**Category:** Rails\
**Created:** [April 5, 2009, 10:14am UTC](https://www.ruby-forum.com/t/testing-application-controller-and-helper/164752 "2009-04-05T10:14:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shamarock](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@shamarock](https://www.ruby-forum.com/u/shamarock)\
**Post date:** [April 5, 2009, 10:14am UTC](https://www.ruby-forum.com/t/testing-application-controller-and-helper/164752/1 "2009-04-05T10:14:23Z")

</div>

How do we test application controller and application helper in rails?

Thanks in advance…

- 

Shauma.

---

<div class="post-metadata">

**Author:** ![shamarock](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/34f0e0/32.png) [@shamarock](https://www.ruby-forum.com/u/shamarock)\
**Post date:** [April 5, 2009, 12:51pm UTC](https://www.ruby-forum.com/t/testing-application-controller-and-helper/164752/2 "2009-04-05T12:51:50Z")

</div>

Shaum Sona wrote:

> How do we test application controller and application helper in rails?

Two answers.

The best answer is you should use Test-Driven Development, where you  
write a  
test that fails because a minor ability of a feature is not there, and  
you get  
the test to fail for the correct reason. Then you write a little code to  
provide  
the ability and pass the test.

The great thing about TDD is you are not required to make sure the test  
actually  
calls the exact method that provides the ability. Sometimes that’s a  
good goal,  
yet TDD provides such comprehensive test coverage that the ideal of  
“unit”  
testing becomes less important.

You TDD the application controller and helper by firing up the usual  
functional  
tests on your usual controllers and views, and TDDing their features.

The second answer: El Goog would have lead you to “rails helper tests”:

[http://nubyonrails.com/articles/test-your-helpers](http://nubyonrails.com/articles/test-your-helpers)

The third answer is I don’t see why a functional test cannot simply  
reach out to  
ApplicationController alone…

–  
Phlip
