From 763f8465eb44dfa192d9e0c860b2fc7802d0496c Mon Sep 17 00:00:00 2001
From: Alex Harrison <alex@harrison.se>
Date: Sun, 12 Feb 2012 22:43:52 +0100
Subject: [PATCH] Added test for adding target=_blank to autolinks

---
 spec/javascripts/app/helpers/text_formatter_spec.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/spec/javascripts/app/helpers/text_formatter_spec.js b/spec/javascripts/app/helpers/text_formatter_spec.js
index 6d408c130b..3751301478 100644
--- a/spec/javascripts/app/helpers/text_formatter_spec.js
+++ b/spec/javascripts/app/helpers/text_formatter_spec.js
@@ -40,7 +40,9 @@ describe("app.helpers.textFormatter", function(){
       var wrapper = $("<div>").html(formattedText);
 
       _.each(links, function(link) {
-        expect(wrapper.find("a[href='" + link + "']").text()).toContain(link)
+        var linkElement = wrapper.find("a[href='" + link + "']");
+        expect(linkElement.text()).toContain(link);
+        expect(linkElement.attr("target")).toContain("_blank");
       })
     })
   })
-- 
GitLab