Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Test case for flatiron/plates#59

  • Loading branch information...
commit ccd9bbd5b5c8469923b845f8492d51990ab01776 1 parent 8ce1fe5
@dougalcampbell authored
View
7 test/api-test.js
@@ -215,6 +215,13 @@ vows.describe('merge data into markup').addBatch({
return common.createTest('test-20', map);
}()
+ ),
+
+ '(21) Keep your place after handling nested objects': (
+
+ function() {
+ return common.createTest('test-21');
+ }()
)
}
View
11 test/fixtures/test-21.html
@@ -0,0 +1,11 @@
+<div id="entries">
+ <div class="entry">
+ <div class="created"></div>
+ <div class="user">
+ <div class="name"></div>
+ <div class="city"></div>
+ <div class="state"></div>
+ </div>
+ <div class="custid"></div>
+ </div>
+</div>
View
31 test/fixtures/test-21.json
@@ -0,0 +1,31 @@
+{
+ "entries": [
+ {
+ "custid": 10101,
+ "created": "2001-01-01",
+ "user": {
+ "name": "John Q. User",
+ "city": "Atlanta",
+ "state": "GA"
+ }
+ },
+ {
+ "custid": 20202,
+ "created": "2002-02-02",
+ "user": {
+ "name": "Jane Q. User",
+ "city": "Mobile",
+ "state": "AL"
+ }
+ },
+ {
+ "custid": 30303,
+ "created": "2003-0303",
+ "user": {
+ "name": "Professor X",
+ "city": "Menlo",
+ "state": "CA"
+ }
+ }
+ ]
+}
View
29 test/fixtures/test-21.out
@@ -0,0 +1,29 @@
+<div id="entries">
+ <div class="entry">
+ <div class="created">2001-01-01</div>
+ <div class="user">
+ <div class="name">John Q. User</div>
+ <div class="city">Atlanta</div>
+ <div class="state">GA</div>
+ </div>
+ <div class="custid">10101</div>
+ </div>
+ <div class="entry">
+ <div class="created">2002-02-02</div>
+ <div class="user">
+ <div class="name">Jane Q. User</div>
+ <div class="city">Mobile</div>
+ <div class="state">AL</div>
+ </div>
+ <div class="custid">20202</div>
+ </div>
+ <div class="entry">
+ <div class="created">2003-0303</div>
+ <div class="user">
+ <div class="name">Professor X</div>
+ <div class="city">Menlo</div>
+ <div class="state">CA</div>
+ </div>
+ <div class="custid">30303</div>
+ </div>
+</div>
Please sign in to comment.
Something went wrong with that request. Please try again.