Update to Rails 2.3.8

This commit is contained in:
Jacques Distler 2010-05-25 12:45:45 -05:00
parent 6677b46cb4
commit f0635301aa
429 changed files with 17683 additions and 4047 deletions

View file

@ -71,6 +71,19 @@ class BaseErrorsTest < Test::Unit::TestCase
end
end
def test_should_mark_as_invalid_when_content_type_is_unavailable_in_response_header
ActiveResource::HttpMock.respond_to do |mock|
mock.post "/people.xml", {}, %q(<?xml version="1.0" encoding="UTF-8"?><errors><error>Age can't be blank</error><error>Name can't be blank</error><error>Name must start with a letter</error><error>Person quota full for today.</error></errors>), 422, {}
mock.post "/people.json", {}, %q({"errors":["Age can't be blank","Name can't be blank","Name must start with a letter","Person quota full for today."]}), 422, {}
end
[ :json, :xml ].each do |format|
invalid_user_using_format(format) do
assert !@person.valid?
end
end
end
private
def invalid_user_using_format(mime_type_reference)
previous_format = Person.format