Skip to content

Commit

Permalink
Added encoding tests from Chris Finne: http://gist.github.com/364074
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Reeder committed Jul 15, 2010
1 parent 7ead7ab commit 1bd83c0
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion test/test_encodings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,30 @@ class Person < SimpleRecord::Base
end
class TestEncodings < TestBase


def test_ascii_http_post
first_name = "joe" + ("X" * 1000) # pad the field to help get the URL over the 2000 length limit so AWS uses a POST
last_name = "blow" + ("X" * 1000) # pad the field to help get the URL over the 2000 length limit so AWS uses a POST
mm = MyModel.create :first_name=>first_name, :last_name=>last_name
mm.save
sleep 1
assert mm.first_name == first_name
assert mm.last_name == last_name
mm2 = MyModel.find(mm.id)
assert mm2.first_name == first_name
assert mm2.last_name == last_name
end

def test_utf8_http_post
first_name = "josé" + ("X" * 1000) # pad the field to help get the URL over the 2000 length limit so AWS uses a POST
last_name = "??" + ("X" * 1000) # pad the field to help get the URL over the 2000 length limit so AWS uses a POST
mm = MyModel.create :first_name=>first_name, :last_name=>last_name
mm.save
sleep 1
assert mm.first_name == first_name
assert mm.last_name == last_name
mm2 = MyModel.find(mm.id)
assert mm2.first_name == first_name
assert mm2.last_name == last_name
end

end

0 comments on commit 1bd83c0

Please sign in to comment.