Writing a spec for helper with Ruby on Rails and RSpec

Posted by TK on Stack Overflow See other posts from Stack Overflow or by TK
Published on 2010-01-03T23:24:28Z Indexed on 2010/04/20 8:03 UTC
Read the original article Hit count: 254

Filed under:
|
|
|

I have been writing specs for controllers and models, but I have never written a helper spec. I have no idea where I start.

I have the following snippet in application_helper.rb

  def title(page_title)
    content_for(:title) { page_title }
  end
  • How should I write a helper spec on the code?
  • Also if there's any open-source Rails app to show good helper testing/specing, do let me know.

© Stack Overflow or respective owner

Related posts about rspec

Related posts about ruby-on-rails