Undefined method `render' thrown in helper tet


#1

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:

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

And in my_helper_test.rb

I’m trying:

  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.


#2

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:

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

And in my_helper_test.rb

I’m trying:

  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.