/ Published in: Rails
![](/img/icon_sav.png?v3)
This is the code I use when I want to test a helper.
It uses Factory Girl and Shoulda, but they're not needed to make it work.
It uses Factory Girl and Shoulda, but they're not needed to make it work.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
require File.dirname(__FILE__) + '/../test_helper' require 'action_view/test_case' class MyHelperTest < ActionView::TestCase include MyHelper context 'a helper in some context' do setup do Factory(:some_object) end should 'assert this test' do assert_some_helper_function_works end end end
Comments
![RSS Feed for Comments RSS Icon](/images/rss.png?v3)