aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/partial_iteration_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionview/test/template/partial_iteration_test.rb')
-rw-r--r--actionview/test/template/partial_iteration_test.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/actionview/test/template/partial_iteration_test.rb b/actionview/test/template/partial_iteration_test.rb
index af0dde96c3..695f9f1bef 100644
--- a/actionview/test/template/partial_iteration_test.rb
+++ b/actionview/test/template/partial_iteration_test.rb
@@ -3,28 +3,31 @@ require 'action_view/renderer/partial_renderer'
class PartialIterationTest < ActiveSupport::TestCase
def test_has_size_and_index
- iteration = ActionView::PartialIteration.new 3, 0
+ iteration = ActionView::PartialIteration.new 3
assert_equal 0, iteration.index, "should be at the first index"
assert_equal 3, iteration.size, "should have the size"
end
def test_first_is_true_when_current_is_at_the_first_index
- iteration = ActionView::PartialIteration.new 3, 0
+ iteration = ActionView::PartialIteration.new 3
assert iteration.first?, "first when current is 0"
end
def test_first_is_false_unless_current_is_at_the_first_index
- iteration = ActionView::PartialIteration.new 3, 1
+ iteration = ActionView::PartialIteration.new 3
+ iteration.iterate!
assert !iteration.first?, "not first when current is 1"
end
def test_last_is_true_when_current_is_at_the_last_index
- iteration = ActionView::PartialIteration.new 3, 2
+ iteration = ActionView::PartialIteration.new 3
+ iteration.iterate!
+ iteration.iterate!
assert iteration.last?, "last when current is 2"
end
def test_last_is_false_unless_current_is_at_the_last_index
- iteration = ActionView::PartialIteration.new 3, 0
+ iteration = ActionView::PartialIteration.new 3
assert !iteration.last?, "not last when current is 0"
end
end