require File.dirname(__FILE__) + '/../spec_helper' describe "when making clickable" do it "should make URLs into links" do text = "Hello http://www.flourish.org goodbye" text = CGI.escapeHTML(text) formatted = MySociety::Format.make_clickable(text) formatted.should == "Hello http://www.flourish.org goodbye" end it "should make wrapped URLs in angle brackets clickable" do text = """ More stuff and then another angle bracket >""" text = CGI.escapeHTML(text) formatted = MySociety::Format.make_clickable(text) formatted.should == "<http://www.flourish.org/blog>\n\nMore stuff and then another angle bracket >" end end