Permalink
Browse files

Add test for making sure attribute placeholder doesn't appear in opti…

…on nodes.
  • Loading branch information...
1 parent 503a336 commit 145fc24977d684875bdff032096923e7d565b542 @imjoshdean imjoshdean committed Jan 7, 2013
Showing with 38 additions and 0 deletions.
  1. +10 −0 view/test/select.ejs
  2. +28 −0 view/view_test.js
View
@@ -0,0 +1,10 @@
+<select id="test-dropdown">
+ <option value="none">
+ <%= domainList.attr('length') %> domains...
+ </option>
+ <% domainList.each(function(domain) { %>
+ <option value="<%= domain.attr('id') %>">
+ <%= domain.attr('name') %>
+ </option>
+ <% }); %>
+</select>
View
@@ -252,4 +252,32 @@
equal(div.innerHTML, 'User id: - User name: -', 'Got expected HTML content in callback as well');
});
});
+
+ test("Select live bound options don't contain __!!__", function() {
+ var domainList = new can.Observe.List([{
+ id: 1,
+ name: 'example.com'
+ }, {
+ id: 2,
+ name: 'google.com'
+ }, {
+ id: 3,
+ name: 'yahoo.com'
+ }, {
+ id: 4,
+ name: 'microsoft.com'
+ }]),
+ frag = can.view("//can/view/test/select.ejs", {
+ domainList: domainList
+ }),
+ div = document.createElement('div');
+
+ div.appendChild(frag);
+can.append( can.$("#qunit-test-area"), div)
+ equal(div.outerHTML.match(/__!!__/g), null, 'No __!!__ contained in HTML content')
+
+ //equal(can.$('#test-dropdown')[0].outerHTML, can.$('#test-dropdown2')[0].outerHTML, 'Live bound select and non-live bound select the same');
+
+
+ })
})();

0 comments on commit 145fc24

Please sign in to comment.