#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    174
    Rep Power
    12

    undefined method `render' thrown in helper tet


    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
    And in my_helper_test.rb

    I'm trying:
    Code:
      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. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Location
    San Jose, CA
    Posts
    58
    Rep Power
    14
    You are probably looking for render_to_string, right?
    Thank you,

    Paul B Hepworth

    Questions & Answers http://www.lds.org

IMN logo majestic logo threadwatch logo seochat tools logo