title: RSpec testing a method that uses a form builder element
body: <p>I was wondering if anyone had an idea on how to implement an Rspec test which can utilize the form builder from rails. Here is what is in my helper:</p>
  
  <pre><code> def render_radio_buttons(answer, label)
      check_these = []
      field = '&lt;div class="radio"&gt;'
        label.split(',').each do |option|
          if check_these.include?(option.strip)
            field += answer.radio_button :body, option.strip, checked = true
          else
            field += answer.radio_button :body, option.strip
          end
          field += label_tag option.strip
        end
      field += '&lt;/div&gt;'
    end
  </code></pre>
  
  <p>This method is pulling a label field from the database which contains multiple comma separated labels. The answer in this case is the form builder f. How would I go about testing something like this since it needs the form builder?</p>
  
  <p>If you have a better rails method on how to implement this, I would love to know! Thanks for anyone who can help!</p>