require File.expand_path(File.dirname(__FILE__) + '/../test_helper') class TableHelperTest < ActionView::TestCase tests TableHelper class Post end def test_should_build_collection_table html = collection_table(['first', 'second', 'last'], Post) do |t| t.header :title t.rows.each do |row, post_title, index| row.title post_title end t.footer :total, t.collection.length end expected = <<-end_str
Title
first
second
last
3
end_str assert_html_equal expected, html end end