autolink spec should test that there is an A tag in the markdownified content and that it's href must equal the link that was posted instead of testing all of the markdownified content..

This commit is contained in:
Dan Hansen 2011-10-02 22:50:39 -05:00
parent 84ff366fef
commit da851881a7

View file

@ -24,7 +24,13 @@ describe MarkdownifyHelper do
end
it 'autolinks standard url links' do
markdownify("http://joindiaspora.com/").should match /<p><a href="http:\/\/joindiaspora.com\/">http:\/\/joindiaspora.com\/<\/a><\/p>/
markdownified = markdownify("http://joindiaspora.com/")
doc = Nokogiri.parse(markdownified)
link = doc.css("a")
link.attr("href").value.should == "http://joindiaspora.com/"
end
context 'when formatting status messages' do