mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Fix: resource object identifier with nil id excludes id
This commit is contained in:
@@ -128,6 +128,13 @@ module ActiveModelSerializers
|
||||
assert_equal actual, expected
|
||||
end
|
||||
|
||||
def test_blank_id
|
||||
@model.id = nil
|
||||
actual = actual_resource_identifier_object(AuthorSerializer)
|
||||
expected = { type: expected_model_type }
|
||||
assert_equal actual, expected
|
||||
end
|
||||
|
||||
def test_id_defined_on_serializer
|
||||
actual = actual_resource_identifier_object(WithDefinedIdSerializer)
|
||||
expected = { id: 'special_id', type: expected_model_type }
|
||||
|
||||
Reference in New Issue
Block a user