title: rails testing helpers with instance variable?
body: <p>I want to test a helper where I use a instance variable inside. I'm using rails 2.3 with the default testing framework. Can please someone write my a simple test (I guess a Unit test) for this? thanks</p>
  
  <p>A simpler version of my code as example.</p>
  
  <pre><code># controller
  @bla = "some value"
  
  # view
  &lt;%= foo %&gt;
  
  # helper
  
  def foo
    @bla.reverse
  end
  </code></pre>
  
  <p>or is it a better practice to write this helper with a parameter call?</p>
  
  <pre><code>def foo(s)
    s.reverse
  end
  </code></pre>