mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Store attributes as they are instead of converting them into Strings
This commit is contained in:
@@ -9,19 +9,19 @@ module ActiveModel
|
||||
end
|
||||
|
||||
def test_attributes_definition
|
||||
assert_equal(['name', 'description'],
|
||||
assert_equal([:name, :description],
|
||||
@profile_serializer.class._attributes)
|
||||
end
|
||||
|
||||
def test_attributes_serialization_using_serializable_hash
|
||||
assert_equal({
|
||||
'name' => 'Name 1', 'description' => 'Description 1'
|
||||
name: 'Name 1', description: 'Description 1'
|
||||
}, @profile_serializer.serializable_hash)
|
||||
end
|
||||
|
||||
def test_attributes_serialization_using_as_json
|
||||
assert_equal({
|
||||
'profile' => { 'name' => 'Name 1', 'description' => 'Description 1' }
|
||||
'profile' => { name: 'Name 1', description: 'Description 1' }
|
||||
}, @profile_serializer.as_json)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user