More Ruby 1.9 Compatibility fixes

Still a long way to go, but these will help.
This commit is contained in:
Jacques Distler 2008-11-12 09:47:24 -06:00
parent 3efc067f06
commit 1b69b148de
7 changed files with 36 additions and 21 deletions

View file

@ -90,7 +90,11 @@ class FileControllerTest < Test::Unit::TestCase
assert_template 'file/file'
# User uploads the picture
picture = File.read("#{RAILS_ROOT}/test/fixtures/rails.gif")
begin # Ruby 1.9
picture = File.read("#{RAILS_ROOT}/test/fixtures/rails.gif", :encoding => 'ascii-8bit')
rescue #Ruby 1.8
picture = File.read("#{RAILS_ROOT}/test/fixtures/rails.gif")
end
# updated from post to get - post fails the spam protection (no javascript)
# Moron! If substituting GET for POST actually works, you
# have much, much bigger problems.

View file

@ -1,4 +1,5 @@
#!/usr/bin/env ruby
#coding: utf-8
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')