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 = """""" text = CGI.escapeHTML(text) formatted = MySociety::Format.make_clickable(text) formatted.should == "<http://www.flourish.org/blog>" end end