Note invalid JSON:API response expected in tests

This commit is contained in:
Benjamin Fleischer 2017-10-29 22:59:21 -05:00
parent 4076a480b7
commit adf5ae27dd
3 changed files with 4 additions and 2 deletions

View File

@ -62,7 +62,7 @@ module ActiveModel
#
# Should be reflection_options[:virtual_value] or adapter needs to figure out what to do
# with an object that is non-nil and has no defined serializer.
cached_result[:virtual_value] = object.try(:as_json) || object
cached_result[:virtual_value] = object
else
cached_result[:serializer] = serializer
end

View File

@ -145,7 +145,7 @@ module ActiveModelSerializers
id: '1',
type: 'posts',
relationships: {
tags: { data: [@tag.as_json] }
tags: { data: [@tag.as_json] } # invalid jsonapi
}
}
}, adapter.serializable_hash)

View File

@ -11,6 +11,7 @@ module ActiveModel
class CustomCommentLoader
def all
# array of hash... shouldn't allow this to be passed through
[{ foo: 'bar' }]
end
end
@ -175,6 +176,7 @@ module ActiveModel
assert_relationship(:locations, expected)
end
# invalid jsonapi...
def test_block_relationship
expected = {
data: [