# Problems with HelperTestCase

**URL:** <https://www.ruby-forum.com/t/problems-with-helpertestcase/114564>\
**Category:** Rails\
**Created:** [September 15, 2007, 1:01pm UTC](https://www.ruby-forum.com/t/problems-with-helpertestcase/114564 "2007-09-15T13:01:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![leonb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/22d042/32.png) [@leonb](https://www.ruby-forum.com/u/leonb)\
**Post date:** [September 15, 2007, 1:01pm UTC](https://www.ruby-forum.com/t/problems-with-helpertestcase/114564/1 "2007-09-15T13:01:33Z")

</div>

Hi all,

I wanted to test my helpers so I installed ZenTest and now I want to use  
HelperTestCase. I created a testcase:  
[http://pastie.caboo.se/97432](http://pastie.caboo.se/97432)

But I get an NameError. Can somebody help me with fixing this? I edited  
the test\_helper.rb to require test/rails.

This the error I get:  
[http://pastie.caboo.se/97431](http://pastie.caboo.se/97431)

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![leonb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/22d042/32.png) [@leonb](https://www.ruby-forum.com/u/leonb)\
**Post date:** [September 16, 2007, 1:38am UTC](https://www.ruby-forum.com/t/problems-with-helpertestcase/114564/2 "2007-09-16T01:38:25Z")

</div>

Fixed the error.

I did: class ApplicationHelperTest \< Test::Rails::HelperTestCase  
instead of: class ApplicationHelperTest \< HelperTestCase

But now I have this new error:  
[http://pastie.caboo.se/97544](http://pastie.caboo.se/97544)

It complains about not finding the method logged\_in?

I created the login-system with acts\_as\_authenticated. I also included  
the AuthenticatedTestHelper in my ApplicationHelperTest, but it doesn’t  
work.

Does anyone know why I get this error?

Thanks again!

---

<div class="post-metadata">

**Author:** ![leonb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/22d042/32.png) [@leonb](https://www.ruby-forum.com/u/leonb)\
**Post date:** [September 16, 2007, 10:26am UTC](https://www.ruby-forum.com/t/problems-with-helpertestcase/114564/3 "2007-09-16T10:26:36Z")

</div>

Yes! Fixed it:

Had to include:

include ActionController::Helpers  
include AuthenticatedSystem  
include AuthenticatedTestHelper

---

<div class="post-metadata">

**Author:** ![leonb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/22d042/32.png) [@leonb](https://www.ruby-forum.com/u/leonb)\
**Post date:** [September 17, 2007, 1:23pm UTC](https://www.ruby-forum.com/t/problems-with-helpertestcase/114564/4 "2007-09-17T13:23:31Z")

</div>

On 9/15/07, Leon B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> This the error I get:  
> [Parked at Loopia](http://pastie.caboo.se/97431)

HelperTestCase is a class inside Test::Rails, so you need to either:

include Test::Rails  
class ApplicationHelperTest \< HelperTestCase

or

class ApplicationHelperTest \< Test::Rails::HelperTestCase

I usually use the second form.

BTW, excellent way to ask a question (hint to others: paste your code!)
