ensures rel="nofollow" is added to all anchors if a page is retrieved with a SHA

This commit is contained in:
rick
2010-09-30 17:19:37 -07:00
parent cc929bbc56
commit 4dbe3ea844
4 changed files with 75 additions and 20 deletions
+10
View File
@@ -71,6 +71,16 @@ context "Markup" do
assert_match /\>Bilbo Baggins\</, output
end
test "adds nofollow to links on historical pages" do
sha1 = @wiki.write_page("Sauron", :markdown, "a [[b]] c", commit_details)
page = @wiki.page("Sauron")
sha2 = @wiki.update_page(page, page.name, :markdown, "c [[b]] a", commit_details)
regx = /rel="nofollow"/
assert_no_match regx, page.formatted_data
assert_match regx, @wiki.page(page.name, sha1).formatted_data
assert_match regx, @wiki.page(page.name, sha2).formatted_data
end
test "absent page link" do
@wiki.write_page("Tolkien", :markdown, "a [[J. R. R. Tolkien]]'s b", commit_details)