# How to add a helper in a functional test

**URL:** <https://www.ruby-forum.com/t/how-to-add-a-helper-in-a-functional-test/180210>\
**Category:** Rails\
**Created:** [December 14, 2009, 8:54pm UTC](https://www.ruby-forum.com/t/how-to-add-a-helper-in-a-functional-test/180210 "2009-12-14T20:54:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [December 14, 2009, 8:54pm UTC](https://www.ruby-forum.com/t/how-to-add-a-helper-in-a-functional-test/180210/1 "2009-12-14T20:54:51Z")

</div>

Hi,

I’m struggling a bit in testing some ajax calls. My problem is that I  
don’t know how to include a helper in a functional TestCase class.

Does anyone know how to do that?

Thanks

---

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [December 14, 2009, 10:25pm UTC](https://www.ruby-forum.com/t/how-to-add-a-helper-in-a-functional-test/180210/2 "2009-12-14T22:25:21Z")

</div>

Fernando P. wrote:

> Hi,
> 
> I’m struggling a bit in testing some ajax calls. My problem is that I  
> don’t know how to include a helper in a functional TestCase class.
> 
> Does anyone know how to do that?

Avoid functional tests entirely. Use Cucumber features instead.  
Problem solved.

> Thanks

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

---

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [December 15, 2009, 12:39am UTC](https://www.ruby-forum.com/t/how-to-add-a-helper-in-a-functional-test/180210/3 "2009-12-15T00:39:20Z")

</div>

Fernando P. wrote:

> > Avoid functional tests entirely. Use Cucumber features instead.  
> > Problem solved.  
> > Whaaat???
> 
> I forced myself in using Rspec because everybody was talking about it. I  
> hated that experience.
> 
> I forced myself in using Cucumber because everybody was talking about  
> it. I hated that experience even more.
> 
> So I got back to test:unit and its functional tests. My whole test suite  
> ran 20% faster and I achieve almost 100% code coverage (cucumber is just  
> so sloooooooow by the way). Only in very rare occasions and on very  
> specific areas I run into ‘glitches’ lie this one.
> 
> But no! Never! I will never go back to rspec or cucumber. That’s the  
> worst piece of advice I have ever heard.

Then you will continue to have problems with clunky functional tests.  
That’s life. I’m sorry I tried to help.

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

---

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [December 14, 2009, 10:50pm UTC](https://www.ruby-forum.com/t/how-to-add-a-helper-in-a-functional-test/180210/4 "2009-12-14T22:50:16Z")

</div>

> Avoid functional tests entirely. Use Cucumber features instead.  
> Problem solved.  
> Whaaat???

I forced myself in using Rspec because everybody was talking about it. I  
hated that experience.

I forced myself in using Cucumber because everybody was talking about  
it. I hated that experience even more.

So I got back to test:unit and its functional tests. My whole test suite  
ran 20% faster and I achieve almost 100% code coverage (cucumber is just  
so sloooooooow by the way). Only in very rare occasions and on very  
specific areas I run into ‘glitches’ lie this one.

But no! Never! I will never go back to rspec or cucumber. That’s the  
worst piece of advice I have ever heard.
