Permalink
Browse files

Added test for conditionals.

  • Loading branch information...
paulyoung committed Jul 26, 2012
1 parent bc50cd9 commit 7a70e92e9c31189abd78909d0b64c79eef91ac3b
Showing with 94 additions and 0 deletions.
  1. +39 −0 test/if.haml
  2. +1 −0 test/if.html
  3. +54 −0 test/if.js
View
@@ -0,0 +1,39 @@
+%ul
+ :each number in numbers
+ %li
+ :if number.one
+ %ul
+ :each color in number.one
+ %li
+ :if color.a
+ = color.a
+ :else if color.b
+ = color.b
+ :else if color.c
+ = color.c
+ :else
+ = color.d
+ :else if number.two
+ %ul
+ :each color in number.two
+ %li
+ :if color.e
+ = color.e
+ :else if color.f
+ = color.f
+ :else if color.g
+ = color.g
+ :else
+ = color.h
+ :else
+ %ul
+ :each color in number.three
+ %li
+ :if color.i
+ = color.i
+ :else if color.j
+ = color.j
+ :else if color.k
+ = color.k
+ :else
+ = color.l
View
@@ -0,0 +1 @@
+<ul><li><ul><li>A</li><li>B</li><li>C</li><li>D</li></ul></li><li><ul><li>E</li><li>F</li><li>G</li><li>H</li></ul></li><li><ul><li>I</li><li>J</li><li>K</li><li>L</li></ul></li></ul>
View
@@ -0,0 +1,54 @@
+{
+ locals: {
+ numbers: {
+ first: {
+ one: {
+ red: {
+ a: "A"
+ },
+ orange: {
+ b: "B"
+ },
+ yellow: {
+ c: "C"
+ },
+ green: {
+ d: "D"
+ }
+ }
+ },
+ second: {
+ two: {
+ blue: {
+ e: "E"
+ },
+ indigo: {
+ f: "F"
+ },
+ violet: {
+ g: "G"
+ },
+ black: {
+ h: "H"
+ }
+ }
+ },
+ third: {
+ three: {
+ grey: {
+ i: "I"
+ },
+ white: {
+ j: "J"
+ },
+ pink: {
+ k: "K"
+ },
+ brown: {
+ l: "L"
+ }
+ }
+ }
+ }
+ }
+}

0 comments on commit 7a70e92

Please sign in to comment.