Forum: Rails deployment undefined method `render' thrown in helper tet

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Clem R. (Guest)
on 2007-04-03 23:49
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:

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

And in my_helper_test.rb

I'm trying:
[code]
  def test_subscribe_email_link
    @subscription_model_class = true
    link = subscribe_email_link
  end
[/code]

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.
Clem R. (Guest)
on 2007-04-09 19:07
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:
>
> [code]
>   def subscribe_email_link
>     if @subscription_model_class
>       render(:partial => '/subscription/toggle')
>     end
>   end
> [/code]
>
> And in my_helper_test.rb
>
> I'm trying:
> [code]
>   def test_subscribe_email_link
>     @subscription_model_class = true
>     link = subscribe_email_link
>   end
> [/code]
>
> 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.
This topic is locked and can not be replied to.