Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisfinne/364074 to your computer and use it in GitHub Desktop.
Save chrisfinne/364074 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment