Revision: 22551
Updated Code
at January 15, 2010 06:49 by nflamel
Updated Code
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
Revision: 22550
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at January 15, 2010 06:48 by nflamel
Initial Code
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
Initial URL
Initial Description
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.
Initial Title
Test a helper class on Ruby On Rails
Initial Tags
rails
Initial Language
Rails