Store attributes as they are instead of converting them into Strings

This commit is contained in:
Santiago Pastorino
2013-09-15 22:07:10 -03:00
parent 10e882a14f
commit 75e9a2599d
11 changed files with 74 additions and 74 deletions

View File

@@ -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