Merge pull request #56 from oozou/for-else

For-else !!!
This commit is contained in:
Tobias Lütke
2011-07-01 11:42:17 -07:00
2 changed files with 25 additions and 4 deletions
@@ -102,6 +102,12 @@ HERE
assigns)
end
def test_for_else
assert_template_result('+++', '{%for item in array%}+{%else%}-{%endfor%}', 'array'=>[1,2,3])
assert_template_result('-', '{%for item in array%}+{%else%}-{%endfor%}', 'array'=>[])
assert_template_result('-', '{%for item in array%}+{%else%}-{%endfor%}', 'array'=>nil)
end
def test_limiting
assigns = {'array' => [1,2,3,4,5,6,7,8,9,0]}
assert_template_result('12', '{%for i in array limit:2 %}{{ i }}{%endfor%}', assigns)