test/unit/body_test.rb in table_helper-0.2.1 vs test/unit/body_test.rb in table_helper-0.2.2
- old
+ new
@@ -108,18 +108,18 @@
@body = TableHelper::Body.new(@table)
end
def test_should_build_row_using_object_location_for_default_index
- build_post = nil
- index = nil
- @body.each {|row, build_post, index|}
+ @build_post = nil
+ @index = nil
+ @body.each {|row, build_post, index| @build_post, @index = build_post, index}
@collection.each do |post|
html = @body.build_row(post)
- assert_equal post, build_post
- assert_equal @collection.index(post), index
+ assert_equal post, @build_post
+ assert_equal @collection.index(post), @index
expected = <<-end_str
<tr class="post ui-collection-result">
<td class="post-title">#{post.title}</td>
</tr>
@@ -127,16 +127,16 @@
assert_html_equal expected, html
end
end
def test_should_build_row_using_custom_value_for_index
- post = nil
- index = nil
- @body.each {|row, post, index|}
+ @post = nil
+ @index = nil
+ @body.each {|row, post, index| @post, @index = post, index}
html = @body.build_row(@collection.first, 1)
- assert_equal @collection.first, post
- assert_equal 1, index
+ assert_equal @collection.first, @post
+ assert_equal 1, @index
expected = <<-end_str
<tr class="post ui-collection-result">
<td class="post-title">first</td>
</tr>