Permalink
Browse files

Added test case for links

  • Loading branch information...
1 parent 5c7aa23 commit c0005b401a86e9d427bb2993f1f9923897116c2d Aron Kornhall committed Oct 19, 2012
Showing with 22 additions and 0 deletions.
  1. +12 −0 test/fixtures/test_links.html
  2. +10 −0 test/test.js
@@ -0,0 +1,12 @@
+<html>
+ <head>
+ </head>
+ <body>
+ <script>
+ setTimeout(function() {
+ var body = document.querySelector('body');
+ body.innerHTML = '<a href="' + window.location.href + '#!hash">link</a>';
+ }, 200);
+ </script>
+ </body>
+</html>
View
@@ -65,6 +65,16 @@ describe('Crawlme', function() {
);
});
+ it('should handle dynamically created links', function(done) {
+ request(
+ {uri: 'http://localhost:3000/test_links.html?_escaped_fragment_='},
+ function(err, res, body) {
+ body.should.match(/<a href="http:\/\/localhost:3000\/test_links.html#!hash">/);
+ done();
+ }
+ );
+ });
+
after(function() {
server.close();
});

0 comments on commit c0005b4

Please sign in to comment.