mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
Note invalid JSON:API response expected in tests
This commit is contained in:
parent
4076a480b7
commit
adf5ae27dd
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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: [
|
||||
|
||||
Loading…
Reference in New Issue
Block a user