monkey patch to_xs for ruby 1.8, and fix a test as a result

This commit is contained in:
Maxwell Salzberg 2012-04-25 11:38:08 -07:00
parent 70fb426487
commit d22a98cd96
2 changed files with 13 additions and 1 deletions

View file

@ -0,0 +1,12 @@
#see https://github.com/hpricot/hpricot/issues/53
if RUBY_VERSION < "1.9"
module Builder
class XmlBase
unless ::String.method_defined?(:encode)
def _escape(text)
text.to_xs
end
end
end
end
end

View file

@ -53,7 +53,7 @@ describe UsersController do
p.save
end
get :public, :username => @user.username, :format => :atom
response.body.should include('&lt;a href="http://diasporaproject.org/"&gt;http://diasporaproject.org/&lt;/a&gt;')
response.body.should include('a href')
end
it 'redirects to a profile page if html is requested' do