# Undefined method \`render' thrown in helper tet

**URL:** <https://www.ruby-forum.com/t/undefined-method-render-thrown-in-helper-tet/91023>\
**Category:** Deployment\
**Created:** [April 3, 2007, 9:49pm UTC](https://www.ruby-forum.com/t/undefined-method-render-thrown-in-helper-tet/91023 "2007-04-03T21:49:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![clemrock](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c57346/32.png) [@clemrock](https://www.ruby-forum.com/u/clemrock)\
**Post date:** [April 3, 2007, 9:49pm UTC](https://www.ruby-forum.com/t/undefined-method-render-thrown-in-helper-tet/91023/1 "2007-04-03T21:49:42Z")

</div>

Hello,

I’m trying to write a very simple test for a very simple method in a  
helper\_test.

Here’s the method I’m testing in my\_helper.rb:

```auto
  def subscribe_email_link
    if @subscription_model_class
      render(:partial => '/subscription/toggle')
    end
  end
```

And in my\_helper\_test.rb

I’m trying:

```auto
  def test_subscribe_email_link
    @subscription_model_class = true
    link = subscribe_email_link
  end
```

The link = subscribe\_email\_link section throws a "undefined method  
`render’ " error

Is there a way I can add render functionality in this helper test?

Thanks for your time.

---

<div class="post-metadata">

**Author:** ![clemrock](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c57346/32.png) [@clemrock](https://www.ruby-forum.com/u/clemrock)\
**Post date:** [April 9, 2007, 5:07pm UTC](https://www.ruby-forum.com/t/undefined-method-render-thrown-in-helper-tet/91023/2 "2007-04-09T17:07:47Z")

</div>

Thanks for your help. I solved the problem w/ this little bit:

\<%= select\_tag(‘public\_all\_categories’,  
options\_for\_select({ :Public =\> 1, ‘–Choose–’ =\> ‘’, :Private =\> 0},  
params[ublic\_all\_categories])) %\>

Problem solved!!!

Clem R. wrote:

> Hello,
> 
> I’m trying to write a very simple test for a very simple method in a  
> helper\_test.
> 
> Here’s the method I’m testing in my\_helper.rb:
> 
> ```auto
> def subscribe_email_link
> > if @subscription_model_class
> > render(:partial => '/subscription/toggle')
> > end
> > end
> ```
> 
> And in my\_helper\_test.rb
> 
> I’m trying:
> 
> ```auto
> def test_subscribe_email_link
> > @subscription_model_class = true
> > link = subscribe_email_link
> > end
> ```
> 
> The link = subscribe\_email\_link section throws a "undefined method  
> `render’ " error
> 
> Is there a way I can add render functionality in this helper test?
> 
> Thanks for your time.
