var jQuery = require('jquery');
var VIE = require('../vie.js');

// Until https://github.com/tmpvar/jsdom/issues/issue/81 is fixed
VIE.RDFa.predicateSelector = '[property]';

exports['test inheriting subject'] = function(test) {
    var html = jQuery('<div about="http://dbpedia.org/resource/Albert_Einstein"><span property="foaf:name">Albert Einstein<span><span property="dbp:dateOfBirth" datatype="xsd:date">1879-03-14</span><div rel="dbp:birthPlace" resource="http://dbpedia.org/resource/Germany" /><span about="http://dbpedia.org/resource/Germany" property="dbp:conventionalLongName">Federal Republic of Germany</span></div>');

    var entities = VIE.RDFa.readEntities(html);
    test.equal(entities.length, 2, "This RDFa defines two entities but they don't get parsed to JSON");

    var entities = VIE.RDFaEntities.getInstances(html);
    test.equal(entities.length, 2, "This RDFa defines two entities but they don't get to Backbone");

    test.done();
};

@@ -345,16 +345,17 @@
 instein%3C
+/
 span%3E%3Csp
@@ -627,33 +627,39 @@
 iv%3E');%0A%0A    var 
-e
+jsonldE
 ntities = VIE.RD
@@ -688,33 +688,39 @@
 %0A    test.equal(
-e
+jsonldE
 ntities.length, 
@@ -800,13 +800,183 @@
     
-var e
+test.equal(jsonldEntities%5B1%5D%5B'foaf:name'%5D, 'Albert Einstein');%0A    test.equal(jsonldEntities%5B0%5D%5B'dbp:conventionalLongName'%5D, 'Federal Republic of Germany');%0A%0A    var backboneE
 ntit
@@ -1033,17 +1033,25 @@
 t.equal(
-e
+backboneE
 ntities.
@@ -1124,24 +1124,198 @@
 ackbone%22);%0A%0A
+    test.equal(backboneEntities%5B1%5D.get('foaf:name'), 'Albert Einstein');%0A    test.equal(backboneEntities%5B0%5D.get('dbp:conventionalLongName'), 'Federal Republic of Germany');%0A%0A
     test.don

Test getting properties as well